0.0
No commit activity in last 3 years
No release in over 3 years
Call 'objectify my_hash' to add accessor methods to my_hash based on the keys currently in the has.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
>= 0
~> 10.0
~> 3.0
 Project Readme

Installation

Add this line to your application's Gemfile:

gem 'hash-to-obj'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hash-to-obj

Usage

Once installed you can simply call objectify on a hash to objectify it!

my_hash = { a: 1, b: 2, c: 3 }
objectify my_hash
my_hash.a # 1
my_hash.b = "b" # { a: 1, b: "b", c: 3 }

If you add new elements to the hash it will not currently create helper methods.