Class: Taro::Types::BaseType
- Inherits:
-
Struct
- Object
- Struct
- Taro::Types::BaseType
- Extended by:
- Shared::AdditionalProperties, Shared::Deprecation, Shared::DerivedTypes, Shared::Description, Shared::Equivalence, Shared::Name, Shared::OpenAPIFormat, Shared::OpenAPIName, Shared::OpenAPIType, Shared::Rendering
- Includes:
- Shared::Caching, Shared::Errors, Shared::TypeClass
- Defined in:
- lib/taro/types/base_type.rb
Overview
Abstract base class for all types.
Concrete type classes must set ‘self.openapi_type` and implement the `#coerce_input` and `#coerce_response` methods.
Instances of types are initialized with the object that they represent. The object is a parameter hash for inputs and a manually passed hash or object when rendering a response.
The type initializer is a hot path for param parsing and response rendering, so we are using Struct instead of Data here for performance reasons: bugs.ruby-lang.org/issues/19693
Direct Known Subclasses
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 collapse
-
#object ⇒ Object
Returns the value of attribute object.
Attributes included from Shared::AdditionalProperties
Attributes included from Shared::Deprecation
Method Summary
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 Attribute Details
#object ⇒ Object
Returns the value of attribute object
13 14 15 |
# File 'lib/taro/types/base_type.rb', line 13 def object @object end |