Class: GraphQL::Client::GatherNamesVisitor

Inherits:
Language::Visitor
  • Object
show all
Defined in:
lib/graphql/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ GatherNamesVisitor

Returns a new instance of GatherNamesVisitor.



434
435
436
437
# File 'lib/graphql/client.rb', line 434

def initialize(node)
  @names = []
  super
end

Instance Attribute Details

#namesObject (readonly)

Returns the value of attribute names.



439
440
441
# File 'lib/graphql/client.rb', line 439

def names
  @names
end

Instance Method Details

#on_fragment_spread(node, parent) ⇒ Object



441
442
443
444
# File 'lib/graphql/client.rb', line 441

def on_fragment_spread(node, parent)
  @names << node.name
  super
end