Class: Lotus::Model::Mapping::Coercer Private
- Inherits:
-
Object
- Object
- Lotus::Model::Mapping::Coercer
- Defined in:
- lib/lotus/model/mapping/coercer.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Translates values from/to the database with the corresponding Ruby type.
Instance Method Summary collapse
-
#from_record(record) ⇒ Object
private
Translates the given record into a Ruby object.
-
#initialize(collection) ⇒ Coercer
constructor
private
Initialize a coercer for the given collection.
-
#to_record(entity) ⇒ Hash
private
Translates the given entity into a format compatible with the database.
Constructor Details
#initialize(collection) ⇒ Coercer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a coercer for the given collection.
17 18 19 20 |
# File 'lib/lotus/model/mapping/coercer.rb', line 17 def initialize(collection) @collection = collection _compile! end |
Instance Method Details
#from_record(record) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Translates the given record into a Ruby object.
41 42 |
# File 'lib/lotus/model/mapping/coercer.rb', line 41 def from_record(record) end |
#to_record(entity) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Translates the given entity into a format compatible with the database.
30 31 |
# File 'lib/lotus/model/mapping/coercer.rb', line 30 def to_record(entity) end |