Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cprussin/accessible-hash
A simple wrapper around the built-in Ruby Hash that behaves like a HashWithIndifferentAccess and also allows object.attribute style access.
https://github.com/cprussin/accessible-hash
Last synced: about 2 months ago
JSON representation
A simple wrapper around the built-in Ruby Hash that behaves like a HashWithIndifferentAccess and also allows object.attribute style access.
- Host: GitHub
- URL: https://github.com/cprussin/accessible-hash
- Owner: cprussin
- Created: 2014-06-17T19:54:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-02T14:25:55.000Z (over 10 years ago)
- Last Synced: 2023-08-30T14:48:13.197Z (over 1 year ago)
- Language: Ruby
- Size: 148 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Accessible Hash](https://connor.prussin.net/accessible-hash)
[![Gem Version](https://badge.fury.io/rb/accessible-hash.svg)](http://rubygems.org/gems/accessible-hash) [![Build Status](https://api.travis-ci.org/cprussin/accessible-hash.svg?branch=master)](https://travis-ci.org/cprussin/accessible-hash) [![Code Climate](https://codeclimate.com/github/cprussin/accessible-hash.png)](https://codeclimate.com/github/cprussin/accessible-hash) [![Dependency Status](https://gemnasium.com/cprussin/accessible-hash.svg)](https://gemnasium.com/cprussin/accessible-hash)
## 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:
```bash
gem install accessible-hash
```or with Bundler (add to your `Gemfile`):
```ruby
gem 'accessible-hash'
```## Usage
```ruby
require 'accessible-hash'foo = AccessibleHash.new(bar: 'baz')
foo['bar'] # => 'baz'
foo[:bar] # => 'baz'
foo.bar # => 'baz'
```