Class: TwoWayMapper::Node::Object

Inherits:
Base
  • Object
show all
Defined in:
lib/two_way_mapper/node/object.rb

Direct Known Subclasses

ActiveRecord

Constant Summary

Constants inherited from Base

Base::DIVIDER

Instance Attribute Summary

Attributes inherited from Base

#options, #selector

Instance Method Summary collapse

Methods inherited from Base

#initialize, #keys, #read, #writable?

Constructor Details

This class inherits a constructor from TwoWayMapper::Node::Base

Instance Method Details

#write(source, value) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/two_way_mapper/node/object.rb', line 6

def write(source, value)
  rewinded = rewind_forward(source, 1)

  return unless writable?(rewinded.send(keys.last), value)

  rewinded.send("#{keys.last}=", value)
end