Class: Stardust::GraphQL::Scalar
- Inherits:
-
GraphQL::Schema::Scalar
- Object
- GraphQL::Schema::Scalar
- Stardust::GraphQL::Scalar
- Defined in:
- lib/stardust/graphql/scalar.rb
Class Method Summary collapse
- .coerce_input(input_value = nil, context = nil, &block) ⇒ Object
- .coerce_result(ruby_value = nil, context = nil, &block) ⇒ Object
Class Method Details
.coerce_input(input_value = nil, context = nil, &block) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/stardust/graphql/scalar.rb', line 5 def self.coerce_input(input_value = nil, context = nil, &block) if block_given? @@__coerce_input_block__ = block else @@__coerce_input_block__.(input_value, context) end end |
.coerce_result(ruby_value = nil, context = nil, &block) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/stardust/graphql/scalar.rb', line 13 def self.coerce_result(ruby_value = nil, context = nil, &block) if block_given? @@__coerce_result_block__ = block else @@__coerce_result_block__.(ruby_value, context) end end |