HashDeepJoin
This gem add Hash#deep_join method to join nested hashes
Installation
Add this line to your application's Gemfile:
gem 'hash_deep_join'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hash_deep_join
Usage
example_data = "memory"=>{"total"=>"3868080", "free"=>"349560"}
example_data.deep_join # => {"memory_total"=>"3868080", "memory_free"=>"349560"}
You can use deep_join with parameter, for example:
example_data = "memory"=>{"total"=>"3868080", "free"=>"349560"}
example_data.deep_join '-' #=> {"memory-total"=>"3868080", "memory-free"=>"349560"}
Contributing
- Fork it ( https://github.com/Ynnni/hash-deep-join/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 a new Pull Request