Skip to content

ReinAkane/hash-to-obj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Simple Ruby gem to objectify hashes

Resources

License

Stars

Watchers

Forks

Packages

No packages published