NeoHash

Gem Version Build Status Code Climate Test Coverage

Accessible Hash and attaching it to an Object

Installation

Add this line to your application's Gemfile:

gem 'neohash'

And then execute:

$ bundle

Or install it yourself as:

$ gem install neohash

Usage

class DynamicObject
  include NeoHash::Support

  def initialize(hash)
    set_inner_hash(hash)
  end
end

obj = DynamicObject.new({ port: 80, "host" => "localhost" })
p obj.port   # 80
p obj[:host] # "localhost"
obj[:host] = "192.168.1.1"
p obj.host   # "192.168.1.1"

License

MIT