Class: Relaxo::Model::Properties::Serialized
- Inherits:
-
Object
- Object
- Relaxo::Model::Properties::Serialized
- Defined in:
- lib/relaxo/model/properties/attribute.rb
Class Method Summary collapse
Instance Method Summary collapse
- #convert_from_primative(dataset, value) ⇒ Object
- #convert_to_primative(value) ⇒ Object
-
#initialize(klass, &serialization) ⇒ Serialized
constructor
A new instance of Serialized.
Constructor Details
#initialize(klass, &serialization) ⇒ Serialized
Returns a new instance of Serialized.
54 55 56 |
# File 'lib/relaxo/model/properties/attribute.rb', line 54 def initialize(klass, &serialization) @klass = klass end |
Class Method Details
.[](klass, proc = nil) ⇒ Object
50 51 52 |
# File 'lib/relaxo/model/properties/attribute.rb', line 50 def self.[](klass, proc = nil) self.new(klass, &proc) end |
Instance Method Details
#convert_from_primative(dataset, value) ⇒ Object
62 63 64 |
# File 'lib/relaxo/model/properties/attribute.rb', line 62 def convert_from_primative(dataset, value) @klass.load(value) end |
#convert_to_primative(value) ⇒ Object
58 59 60 |
# File 'lib/relaxo/model/properties/attribute.rb', line 58 def convert_to_primative(value) @klass.dump(value) end |