Module: Representable::Mapper::Methods
- Included in:
- Representable::Mapper
- Defined in:
- lib/representable/mapper.rb
Instance Attribute Summary collapse
-
#bindings ⇒ Object
readonly
Returns the value of attribute bindings.
Instance Method Summary collapse
- #deserialize(doc, options) ⇒ Object
-
#initialize(bindings, represented, options) ⇒ Object
TODO: get rid of represented dependency.
- #serialize(doc, options) ⇒ Object
Instance Attribute Details
#bindings ⇒ Object (readonly)
Returns the value of attribute bindings.
11 12 13 |
# File 'lib/representable/mapper.rb', line 11 def bindings @bindings end |
Instance Method Details
#deserialize(doc, options) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/representable/mapper.rb', line 13 def deserialize(doc, ) bindings.each do |bin| deserialize_property(bin, doc, ) end @represented end |
#initialize(bindings, represented, options) ⇒ Object
TODO: get rid of represented dependency.
6 7 8 9 |
# File 'lib/representable/mapper.rb', line 6 def initialize(bindings, represented, ) # TODO: get rid of represented dependency. @represented = represented # the (extended) model. @bindings = bindings end |
#serialize(doc, options) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/representable/mapper.rb', line 20 def serialize(doc, ) bindings.each do |bin| serialize_property(bin, doc, ) end doc end |