Class: GraphQL::Client::QueryResult::Scalar
- Inherits:
-
Object
- Object
- GraphQL::Client::QueryResult::Scalar
- Defined in:
- lib/graphql/client/query_result.rb
Overview
:nodoc:
Instance Method Summary collapse
- #cast(value, _errors = nil) ⇒ Object
-
#initialize(type) ⇒ Scalar
constructor
A new instance of Scalar.
- #|(_other) ⇒ Object
Constructor Details
#initialize(type) ⇒ Scalar
Returns a new instance of Scalar.
51 52 53 |
# File 'lib/graphql/client/query_result.rb', line 51 def initialize(type) @type = type end |
Instance Method Details
#cast(value, _errors = nil) ⇒ Object
55 56 57 |
# File 'lib/graphql/client/query_result.rb', line 55 def cast(value, _errors = nil) @type.coerce_input(value) end |
#|(_other) ⇒ Object
59 60 61 62 |
# File 'lib/graphql/client/query_result.rb', line 59 def |(_other) # XXX: How would scalars merge? self end |