You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Erik Hollensbe eaa244ff3f Version bump to 1.0.4 11 years ago
lib * Fixing the fix 11 years ago
test * Fixed an issue with locking where #method/#method= would fail (as it should) but #[]/#[]= wouldn't 12 years ago
.document Initial commit to hashpipe. 12 years ago
.gitignore Initial commit to hashpipe. 12 years ago
LICENSE Initial commit to hashpipe. 12 years ago
README.rdoc * Some RDoc in the README, and Rakefile changes. 12 years ago
Rakefile * Moar docs. 12 years ago
VERSION Version bump to 1.0.4 11 years ago

README.rdoc

= HashPipe -- hash-alike openstructs for ruby.

Come on and kick me.
You’ve got your problems;
I’ve got my ass wide
You’ve got your big G's;
I’ve got my hash pipe.

- Weezer, /Hash Pipe/

HashPipe is a library to supplement users of OpenStruct and similar libs. It
operates leak free at insertion cost and optimizes for the common case:
reading, like a good hash table should. HashPipe includes Enumerable and a
basic keys/values implementation.

HashPipe also contains a locking mechanism whereby you can eliminate the
ability to add more items, similar to Object#freeze in a sense.

Examples:

h = HashPipe.new
h[:foo] = "bar"
h.foo #=> "bar"
h["bar"] = "quux"
h[:bar] #=> "quux"
h.bar #=> "quux"

h.lock! # no new attributes can be created

h.quux # raises
h[:quux] # raises
h['quux'] # raises
h.foo #=> "bar"

h.keys #=> [:foo, :bar]
h.values #=> ["bar", "quux"]

h.map { |k,v| [k,v] } #=> [[:foo, "bar"], [:bar, "quux"]]

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 Erik Hollensbe. See LICENSE for details.