toothrot / johnny-hash

Adds json-object-style Hash accessors in Ruby for fun.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a terrible idea

Jsony-Hash

Examples

hsh = {:a => {'b' => [1, {:c => :d}]}}.json!

hsh.a.b # => [1, {:c=>:d}]

hsh[:a]['b'] # => [1, {:c=>:d}]

hsh.a.b[1].c # => :d

json_object = {"a" => {"b" => {"c" => ["foo", {"d" => "bar"}]}}}.json!

json_object.a['b'].c[1].d # => bar

About

Adds json-object-style Hash accessors in Ruby for fun.


Languages

Language:Ruby 100.0%