diff options
author | Christoffer Sawicki <christoffer.sawicki@gmail.com> | 2008-11-18 23:00:35 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-11-26 14:54:35 +0100 |
commit | 05a938c5f7804fd59c76c45df096e6ebff871a18 (patch) | |
tree | 70872a576afdf06add220d2f59247b30bae2ebc3 /activesupport/lib | |
parent | 63d8f56774dcb1ea601928c3eb6c119d359fae10 (diff) | |
download | rails-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')
-rw-r--r-- | activesupport/lib/active_support/ordered_hash.rb | 8 |
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 |