diff options
author | Michael Bleigh <michael@intridea.com> | 2010-08-10 10:07:54 -0500 |
---|---|---|
committer | Michael Bleigh <michael@intridea.com> | 2010-08-10 10:07:54 -0500 |
commit | 90ab29181e48884be3d67237be8dee7b83055357 (patch) | |
tree | a76714cde2d280f699762e2854cb04ae46b7b29a | |
parent | 5a53de54c1b97c8f16203ad0fef6e95ef4c2a161 (diff) | |
download | hashie-90ab29181e48884be3d67237be8dee7b83055357.tar.gz |
Update README to add Trash.
-rw-r--r-- | README.rdoc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/README.rdoc b/README.rdoc index 7346d9a..4e26518 100644 --- a/README.rdoc +++ b/README.rdoc @@ -61,6 +61,20 @@ can set defaults for each property. p.name # => 'Bob' p.occupation # => 'Rubyist' +== Trash + +A Trash is a Dash that allows you to translate keys on initialization. +It is used like so: + + class Person < Hashie::Trash + property :first_name, :from => :firstName + end + +This will automatically translate the <tt>firstName</tt> key to <tt>first_name</tt> +when it is initialized using a hash such as through: + + Person.new(:firstName => 'Bob') + == Clash Clash is a Chainable Lazy Hash that allows you to easily construct |