Class: TwoWayMapper::Node::Hash

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

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/hash.rb', line 6

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

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

  rewinded[keys.last] = value
end