https://github.com/freedomben/hash-dot
Source code for the 'hash-dot' ruby gem
https://github.com/freedomben/hash-dot
Last synced: about 1 year ago
JSON representation
Source code for the 'hash-dot' ruby gem
- Host: GitHub
- URL: https://github.com/freedomben/hash-dot
- Owner: FreedomBen
- License: mit
- Created: 2015-02-20T20:23:45.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-04-13T02:13:15.000Z (about 7 years ago)
- Last Synced: 2025-02-16T15:14:49.278Z (over 1 year ago)
- Language: Ruby
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hash-dot
Reference hash keys by dot just like in EcmaScript!
For example:
```bash
irb(main):001:0> require 'hash-dot'
=> true
irb(main):002:0> hash = {one: 'two', three: 'four'}
=> {:one=>"two", :three=>"four"}
irb(main):003:0> hash.one
=> "two"
irb(main):004:0> hash[:one]
=> "two"
irb(main):005:0> hash.five = 'six'
=> "six"
irb(main):006:0> hash
=> {:one=>"two", :three=>"four", :five=>"six"}
irb(main):007:0>
```
## Installation
```bash
gem install 'hash-dot'
```
Or add to your `Gemfile`
```ruby
gem 'hash-dot'
```
Add:
```ruby
require 'hash-dot'
```
To your ruby files
## Note on performance
Performance with this gem is abysmal! Don't use this in apps where performance matters.