A simple wrapper around the built-in Ruby Hash that behaves like a HashWithIndifferentAccess and also allows object.attribute style access.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.travis.yml
Gemfile
README.md
Rakefile
accessible-hash.gemspec

README.md

Accessible Hash

Gem Version Build Status Code Climate Dependency Status

Description

Accessible Hash is a simple wrapper around the built-in Ruby Hash that behaves like a HashWithIndifferentAccess and also allows object.attribute style access.

Install

Manually:

gem install accessible-hash

or with Bundler (add to your Gemfile):

gem 'accessible-hash'

Usage

require 'accessible-hash'

foo = AccessibleHash.new(bar: 'baz')
foo['bar']  # => 'baz'
foo[:bar]   # => 'baz'
foo.bar     # => 'baz'