Class: GraphQL::Query::Arguments
- Inherits:
-
Object
- Object
- GraphQL::Query::Arguments
- Extended by:
- Forwardable
- Defined in:
- lib/graphql/query/arguments.rb
Overview
Instance Method Summary collapse
-
#[](key) ⇒ Object
The argument at that key.
-
#initialize(values) ⇒ Arguments
constructor
A new instance of Arguments.
Constructor Details
#initialize(values) ⇒ Arguments
Returns a new instance of Arguments.
9 10 11 12 13 14 |
# File 'lib/graphql/query/arguments.rb', line 9 def initialize(values) @values = values.inject({}) do |memo, (inner_key, inner_value)| memo[inner_key.to_s] = wrap_value(inner_value) memo end end |
Instance Method Details
#[](key) ⇒ Object
Returns the argument at that key.
18 19 20 |
# File 'lib/graphql/query/arguments.rb', line 18 def [](key) @values[key.to_s] end |