Module: Representable::Mapper::Methods
- Included in:
- Representable::Mapper
- Defined in:
- lib/representable/mapper.rb
Instance Method Summary collapse
- #bindings(represented, options) ⇒ Object
- #deserialize(represented, doc, options, private_options) ⇒ Object
- #initialize(bindings) ⇒ Object
- #serialize(represented, doc, options, private_options) ⇒ Object
Instance Method Details
#bindings(represented, options) ⇒ Object
10 11 12 13 14 |
# File 'lib/representable/mapper.rb', line 10 def bindings(represented, ) @bindings.each do |binding| binding.update!(represented, ) end end |
#deserialize(represented, doc, options, private_options) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/representable/mapper.rb', line 16 def deserialize(represented, doc, , ) bindings(represented, ).each do |bin| deserialize_property(bin, doc, , ) end represented end |
#initialize(bindings) ⇒ Object
6 7 8 |
# File 'lib/representable/mapper.rb', line 6 def initialize(bindings) @bindings = bindings end |
#serialize(represented, doc, options, private_options) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/representable/mapper.rb', line 23 def serialize(represented, doc, , ) bindings(represented, ).each do |bin| serialize_property(bin, doc, , ) end doc end |