MagicHash
MagicHash it's just a helper that gives you an empty hash, that returns itself on missing keys.
Installation
Add this line to your application's Gemfile:
gem 'magic_hash'
And then execute:
$ bundle
Or install it yourself as:
$ gem install magic_hash
Usage
h = MagicHash.new
h[:foo][:bar] = :baz
#=> :baz
h
#=> {:foo=>{:bar=>:baz}}
Contributing
- Fork it ( https://github.com/dscataglini/magic_hash/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request