Skip to content

cprussin/accessible-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages