A simple gem that implements a bidrectional hash
Use as a hash, except that keys and values are interchangeable.
abbreviations = Bihash["abbr" => "abbreviation"]
# => Bihash["abbr"=>"abbreviation"]
abbreviations["lol"] = "laugh out loud"
# => "laugh out loud"
puts abbreviations
# => Bihash["abbr"=>"abbreviation", "lol"=>"laugh out loud"]
abbreviations["lol"]
# => "laugh out loud"
abbreviations["laugh out loud"]
# => "lol"
After checking out the repo, run bin/setup
to install dependencies. Then, run
rake spec
to run the specs. You can also run bin/console
for an interactive
prompt that will allow you to experiment.
Bug reports and pull requests are welcome on GitHub at https://github.com/Cohen-Carlisle/bihash. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.