HashEx
HashEx::JsObject
- JavaScript-Object-like hash.HashEx::Base
- Abstract base class.
Installation
Add this line to your application's Gemfile:
gem 'HashEx'
And then execute:
$ bundle
Or install it yourself as:
$ gem install HashEx
Usage
HashEx::Base
Just override HashEx::Base#convert_key
to create your own one
HashEx::JsObject
It works like JS Object. For an instance h
:
h[:key]
,h['key']
andh.key
are equal.h.a = { foo: { bar: { baz: 123} } }
will convertHash
toHashEx::JsObject
recursively.h.a.foo
andh.a.foo.bar
will be instances ofHashEx::JsObject
.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/eGust/HashEx.
License
The gem is available as open source under the terms of the MIT License.