Class: GraphQL::Language::Nodes::InputObject

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, #children, #initialize, #position

Constructor Details

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

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



152
153
154
# File 'lib/graphql/language/nodes.rb', line 152

def arguments
  @arguments
end

Instance Method Details

#initialize_node(arguments: []) ⇒ Object



155
156
157
# File 'lib/graphql/language/nodes.rb', line 155

def initialize_node(arguments: [])
  @arguments = arguments
end

#to_h(options = {}) ⇒ Object



159
160
161
162
163
164
165
# File 'lib/graphql/language/nodes.rb', line 159

def to_h(options={})
  arguments.inject({}) do |memo, pair|
    v = pair.value
    memo[pair.name] = v.is_a?(InputObject) ? v.to_h : v
    memo
  end
end