Class: Ardm::Ar::Serialization::Type
- Inherits:
-
Object
- Object
- Ardm::Ar::Serialization::Type
- Defined in:
- lib/ardm/ar/serialization.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(column) ⇒ Type
constructor
A new instance of Type.
- #type ⇒ Object
- #type_cast(value) ⇒ Object
Constructor Details
#initialize(column) ⇒ Type
Returns a new instance of Type.
63 64 65 |
# File 'lib/ardm/ar/serialization.rb', line 63 def initialize(column) @column = column end |
Instance Method Details
#type ⇒ Object
75 76 77 |
# File 'lib/ardm/ar/serialization.rb', line 75 def type @column.type end |
#type_cast(value) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/ardm/ar/serialization.rb', line 67 def type_cast(value) if value.state == :serialized value.unserialized_value @column.type_cast value.value else value.unserialized_value end end |