Class: Taro::Types::ObjectTypes::FreeFormType
- Inherits:
-
Taro::Types::ObjectType
- Object
- BaseType
- Taro::Types::ObjectType
- Taro::Types::ObjectTypes::FreeFormType
- Defined in:
- lib/taro/types/object_types/free_form_type.rb
Instance Method Summary collapse
Methods included from Shared::Fields
Methods included from Shared::CustomFieldResolvers
Instance Method Details
#coerce_input ⇒ Object
6 7 8 |
# File 'lib/taro/types/object_types/free_form_type.rb', line 6 def coerce_input object.is_a?(Hash) && object || input_error('must be a Hash') end |
#coerce_response ⇒ Object
10 11 12 13 |
# File 'lib/taro/types/object_types/free_form_type.rb', line 10 def coerce_response object.respond_to?(:as_json) && (res = object.as_json).is_a?(Hash) && res || response_error('must return a Hash from #as_json') end |