aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/ordered_hash.rb
diff options
context:
space:
mode:
authorChristoffer Sawicki <christoffer.sawicki@gmail.com>2008-11-18 23:00:35 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-11-26 14:54:35 +0100
commit05a938c5f7804fd59c76c45df096e6ebff871a18 (patch)
tree70872a576afdf06add220d2f59247b30bae2ebc3 /activesupport/lib/active_support/ordered_hash.rb
parent63d8f56774dcb1ea601928c3eb6c119d359fae10 (diff)
downloadrails-05a938c5f7804fd59c76c45df096e6ebff871a18.tar.gz
rails-05a938c5f7804fd59c76c45df096e6ebff871a18.tar.bz2
rails-05a938c5f7804fd59c76c45df096e6ebff871a18.zip
Added ActiveSupport::OrderedHash#each_key and ActiveSupport::OrderedHash#each_value [#1410 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support/ordered_hash.rb')
-rw-r--r--activesupport/lib/active_support/ordered_hash.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb
index 9757054e43..5de94c67e0 100644
--- a/activesupport/lib/active_support/ordered_hash.rb
+++ b/activesupport/lib/active_support/ordered_hash.rb
@@ -53,6 +53,14 @@ module ActiveSupport
end
alias_method :value?, :has_value?
+
+ def each_key
+ each { |key, value| yield key }
+ end
+
+ def each_value
+ each { |key, value| yield value }
+ end
end
end
end