From 495d86392d8cce1b7cf822233501553b95ee1e05 Mon Sep 17 00:00:00 2001 From: Nick Gauthier Date: Thu, 4 Feb 2010 11:25:07 -0500 Subject: [PATCH] documented hash --- lib/hydra/hash.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/hydra/hash.rb b/lib/hydra/hash.rb index 0358141..4d445e0 100644 --- a/lib/hydra/hash.rb +++ b/lib/hydra/hash.rb @@ -1,10 +1,12 @@ class Hash + # Stringify the keys in the hash. Returns a new hash. def stringify_keys inject({}) do |options, (key, value)| options[key.to_s] = value options end end + # Stringify the keys in the hash in place. def stringify_keys! keys.each do |key| self[key.to_s] = delete(key)