File tree Expand file tree Collapse file tree
lib/graphql/internal_representation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,26 +6,9 @@ class Node
66 DEFAULT_TYPED_CHILDREN = Proc . new { |h , k | h [ k ] = { } }
77
88 # A specialized, reusable object for leaf nodes.
9- # Behaves like a Hash, but doesn't copy itself.
10- # @api private
11- class NoTypedChildren
12- CHILDREN = { } . freeze
13- def dup ; self ; end
14- def any? ; false ; end
15- def none? ; true ; end
16- def []( key ) ; CHILDREN ; end
17- def each ; end
18-
19- # Compatibility for when this was an Array:
20- def method_missing ( method_name , *args , &block )
21- if CHILDREN . respond_to? ( method_name )
22- CHILDREN . send ( method_name , *args , &block )
23- else
24- raise NotImplementedError
25- end
26- end
27- end
28- NO_TYPED_CHILDREN = NoTypedChildren . new
9+ NO_TYPED_CHILDREN = Hash . new ( [ ] . freeze )
10+ def NO_TYPED_CHILDREN . dup ; self ; end ;
11+ NO_TYPED_CHILDREN . freeze
2912
3013 # @return [String] the name this node has in the response
3114 attr_reader :name
You can’t perform that action at this time.
0 commit comments