Class: JsonApiClient::Schema::Property
- Inherits:
-
Struct
- Object
- Struct
- JsonApiClient::Schema::Property
- Defined in:
- lib/json_api_client/schema.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default
31 32 33 |
# File 'lib/json_api_client/schema.rb', line 31 def default @default end |
#name ⇒ Object
Returns the value of attribute name
31 32 33 |
# File 'lib/json_api_client/schema.rb', line 31 def name @name end |
#type ⇒ Object
Returns the value of attribute type
31 32 33 |
# File 'lib/json_api_client/schema.rb', line 31 def type @type end |
Instance Method Details
#cast(value) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/json_api_client/schema.rb', line 32 def cast(value) return nil if value.nil? return value if type.nil? if caster = Schema.find_property_type(type) caster.call(value) else value end end |