Class: Taro::Types::ObjectTypes::FreeFormType
- Inherits:
-
Taro::Types::ObjectType
- Object
- Struct
- BaseType
- Taro::Types::ObjectType
- Taro::Types::ObjectTypes::FreeFormType
- Defined in:
- lib/taro/types/object_types/free_form_type.rb
Constant Summary
Constants included from Shared::OpenAPIFormat
Shared::OpenAPIFormat::OPENAPI_INTEGER_FORMATS, Shared::OpenAPIFormat::OPENAPI_NUMBER_FORMATS, Shared::OpenAPIFormat::OPENAPI_STRING_FORMATS
Constants included from Shared::OpenAPIType
Shared::OpenAPIType::OPENAPI_TYPES
Instance Attribute Summary
Attributes inherited from BaseType
Attributes included from Shared::AdditionalProperties
Attributes included from Shared::Deprecation
Instance Method Summary collapse
Methods included from Shared::Fields
Methods included from Shared::CustomFieldResolvers
Methods included from Shared::AdditionalProperties
#additional_properties?, #inherited
Methods included from Shared::DerivedTypes
#define_derived_type, #derived_types, map
Methods included from Shared::Description
Methods included from Shared::Equivalence
#equal_properties?, #equivalent?
Methods included from Shared::Name
Methods included from Shared::OpenAPIFormat
#inherited, #openapi_format, #openapi_format=
Methods included from Shared::OpenAPIName
#default_openapi_name, #openapi_name, #openapi_name=
Methods included from Shared::OpenAPIType
#inherited, #openapi_type, #openapi_type=
Methods included from Shared::Rendering
#last_render, #last_render=, #render, #used_in_response
Methods included from Shared::TypeClass
Methods included from Shared::Errors
#coerce_error_message, #input_error, #response_error
Methods included from Shared::Caching
#cached_coerce_response, included
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 |