https://github.com/derrickreimer/seekable_hash
A simple gem for looking up values in deeply-nested hashes.
https://github.com/derrickreimer/seekable_hash
hash ruby
Last synced: over 1 year ago
JSON representation
A simple gem for looking up values in deeply-nested hashes.
- Host: GitHub
- URL: https://github.com/derrickreimer/seekable_hash
- Owner: derrickreimer
- License: mit
- Created: 2014-07-26T18:46:57.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-01-02T03:19:42.000Z (over 10 years ago)
- Last Synced: 2025-03-25T01:47:31.297Z (over 1 year ago)
- Topics: hash, ruby
- Language: Ruby
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SeekableHash
[](https://codeclimate.com/github/djreimer/seekable_hash)
A simple Ruby gem for looking up values in deeply-nested hashes.
## Installation
Add this line to your application's Gemfile:
gem 'seekable_hash'
And then execute:
$ bundle
Or install it yourself as:
$ gem install seekable_hash
## Usage
```ruby
hash = {
"foo" => {
"bar" => {
"baz" => "boot"
}
}
}
sh = SeekableHash[hash]
sh.seek("foo", "bar", "baz")
#=> "boot"
sh.seek("boot")
#=> nil
```
## Contributing
1. Fork it ( https://github.com/djreimer/seekable_hash/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request