keyvaluetree
keyvalutree provides an wrapper around a flat KeyValueStore which emulates an hierachical store (i.e. nested Hashes).
Installation
Add this line to your application's Gemfile:
gem 'keyvaluetree'
And then execute:
$ bundle
Or install it yourself as:
$ gem install keyvaluetree
Usage
Simple
config = KeyValueTree::Hash.new()
config.server.name = 'localhost'
config.server['port'] = '123'
config.server['name'] => 'localhost'
config.server.port = '123'
Using explicit MemoryStore
config = KeyValueTree::Hash.new(KeyValueTree::MemoryStore.new())
config.server.name = 'localhost'
config.server['port'] = '123'
config.server['name'] => 'localhost'
config.server.port = '123'
Contributing
- Fork it
- 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