Class: SerializableAttributes::Float
- Inherits:
-
AttributeType
- Object
- AttributeType
- SerializableAttributes::Float
- Defined in:
- lib/serializable_attributes/types.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
Instance Method Summary collapse
Methods inherited from AttributeType
#encode, #initialize, #type_for
Constructor Details
This class inherits a constructor from SerializableAttributes::AttributeType
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
24 25 26 |
# File 'lib/serializable_attributes/types.rb', line 24 def default @default end |
Instance Method Details
#parse(input) ⇒ Object
25 |
# File 'lib/serializable_attributes/types.rb', line 25 def parse(input) input.blank? ? nil : input.to_f end |