Class: GraphQL::Language::Nodes::Argument

Inherits:
AbstractNode show all
Defined in:
lib/graphql/language/nodes.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#col, #line

Instance Method Summary collapse

Methods inherited from AbstractNode

child_attributes, #eql?, inherited, #initialize, #position, scalar_attributes, #scalars, #to_query_string

Constructor Details

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

Instance Attribute Details

#nameObject

Returns the value of attribute name.



101
102
103
# File 'lib/graphql/language/nodes.rb', line 101

def name
  @name
end

#valueObject

Returns the value of attribute value.



101
102
103
# File 'lib/graphql/language/nodes.rb', line 101

def value
  @value
end

Instance Method Details

#childrenObject



109
110
111
# File 'lib/graphql/language/nodes.rb', line 109

def children
  [value].flatten.select { |v| v.is_a?(AbstractNode) }
end

#initialize_node(name: nil, value: nil) ⇒ Object



104
105
106
107
# File 'lib/graphql/language/nodes.rb', line 104

def initialize_node(name: nil, value: nil)
  @name = name
  @value = value
end