Class: GraphQL::Client::Query::Argument
- Inherits:
-
Struct
- Object
- Struct
- GraphQL::Client::Query::Argument
- Defined in:
- lib/graphql_client/query/argument.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value
6 7 8 |
# File 'lib/graphql_client/query/argument.rb', line 6 def value @value end |
Instance Method Details
#to_query ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/graphql_client/query/argument.rb', line 7 def to_query case value when FalseClass, Float, Integer, NilClass, String, TrueClass generate_query_value(value) when Array "[#{value.map { |v| generate_query_value(v) }.join(', ')}]" when Hash "{ #{value.map { |k, v| "#{k}: #{generate_query_value(v)}" }.join(', ')} }" end end |