Skip to content

mtodd/with_reverse_lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

With Reverse Lookup

Extends a hash to be able to look up keys by value (for bi-directional hashes).

Sample

table = {
  :foo => "Foo",
  :bar => "Bar",
  :baz => "Baz"
}.extend(WithReverseLookup)

table[:foo]   #=> "Foo"
table["Foo"]  #=> :foo

License

MIT

Copyright

Copyright © 2010 Matt Todd.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages