Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 877 Bytes

README.md

File metadata and controls

27 lines (17 loc) · 877 Bytes

Quacks like a Hash, but contains one additional method (commit) to help you merge changes from child hashes. I use it like Martin Fowler's Unit of Work pattern - http://martinfowler.com/eaaCatalog/unitOfWork.html

Circle CI Build Status Build Status

Typical usage:

require 'rubygems'
require 'sonofhash'

parent = SonOfHash.new
child = parent.new_child

parent['name'] = 'Moondublin'
puts child['name']            # Moondublin

child['name'] = 'Lugrat'
puts parent['name']           # Moondublin

child.commit
puts parent['name']           # Lugrat

Tests

bundle install --path vendor/bundle
bundle exec rake