summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMax Lincoln <max@devopsy.com>2014-12-23 15:06:40 -0500
committerdblock <dblock@dblock.org>2014-12-30 16:01:47 -0500
commit0e40e63ebc0bdec0af98de2b54fddb5199f19515 (patch)
tree0dd3b133f38e2b4055506c0540daec2bafb9bb54 /README.md
parent12f031b013cae5463a4fe42f416fef75edfcdf94 (diff)
downloadhashie-0e40e63ebc0bdec0af98de2b54fddb5199f19515.tar.gz
Public utility methods for stringify/symbolize keys
Diffstat (limited to 'README.md')
-rw-r--r--README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/README.md b/README.md
index 5f4b80f..006376b 100644
--- a/README.md
+++ b/README.md
@@ -141,6 +141,19 @@ end
The KeyConversion extension gives you the convenience methods of `symbolize_keys` and `stringify_keys` along with their bang counterparts. You can also include just stringify or just symbolize with `Hashie::Extensions::StringifyKeys` or `Hashie::Extensions::SymbolizeKeys`.
+Hashie also has a utility method for converting keys on a Hash within including a mixin:
+
+```ruby
+Hashie.symbolize_keys! hash
+# => Symbolizes keys of hash.
+Hashie.symbolize_keys hash
+# => Returns a copy of hash with keys symbolized.
+Hashie.stringify_keys hash
+# => Stringifies keys of hash.
+Hashie.stringify_keys hash
+# => Returns a copy of hash with keys stringified.
+```
+
### MergeInitializer
The MergeInitializer extension simply makes it possible to initialize a Hash subclass with another Hash, giving you a quick short-hand.