Class: JSONAPI::Consumer::Schema::Property
- Inherits:
-
Struct
- Object
- Struct
- JSONAPI::Consumer::Schema::Property
- Defined in:
- lib/jsonapi/consumer/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
97 98 99 |
# File 'lib/jsonapi/consumer/schema.rb', line 97 def default @default end |
#name ⇒ Object
Returns the value of attribute name
97 98 99 |
# File 'lib/jsonapi/consumer/schema.rb', line 97 def name @name end |
#type ⇒ Object
Returns the value of attribute type
97 98 99 |
# File 'lib/jsonapi/consumer/schema.rb', line 97 def type @type end |
Instance Method Details
#cast(value) ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/jsonapi/consumer/schema.rb', line 98 def cast(value) return nil if value.nil? return value if type.nil? type_caster = TypeFactory.type_for(type) return value if type_caster.nil? type_caster.cast(value, default) end |