Project

HashEx

0.0
No commit activity in last 3 years
No release in over 3 years
HashEx::Base is an abstract class need to override #convert_key. HashEx::JsObject is a JavaScript-Object-like Hash.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0
 Project Readme

HashEx

  1. HashEx::JsObject - JavaScript-Object-like hash.
  2. 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:

  1. h[:key], h['key'] and h.key are equal.
  2. h.a = { foo: { bar: { baz: 123} } } will convert Hash to HashEx::JsObject recursively. h.a.foo and h.a.foo.bar will be instances of HashEx::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.