Project

hashdot

0.0
No commit activity in last 3 years
No release in over 3 years
Hashdot provides a nice JavaScript/Lua-style accessor for each key in your hash without much fuzz
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

Hashdot - cozy hash accessors.

Hashdot provides a nicer way to access stuff in your hashes, if you've ever done JavaScript, Lua or countless others you'll be familiar with it.

Note: This is a terrible monkeypatch of the Hash class, I would advise against using it in large production systems, I wrote it because I find it comfortable to write in this style smaller scripts. Consider yourself warned. ¯_(ツ)_/¯

require 'hashdot'

hash = {
  :symbol_key   => 1,
  "string_key"  => 2
}

hash.symbol_key #=> 1
hash.string_key #=> 2

That's pretty much it.

Running tests

$ make test