aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/ordered_hash.rb
diff options
context:
space:
mode:
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 5b8c342f4f..b2f04b427b 100644
--- a/activesupport/lib/active_support/ordered_hash.rb
+++ b/activesupport/lib/active_support/ordered_hash.rb
@@ -1,3 +1,8 @@
+begin
+ require 'psych'
+rescue LoadError
+end
+
require 'yaml'
YAML.add_builtin_type("omap") do |type, val|
@@ -133,14 +138,17 @@ module ActiveSupport
def each_key
@keys.each { |key| yield key }
+ self
end
def each_value
@keys.each { |key| yield self[key]}
+ self
end
def each
@keys.each {|key| yield [key, self[key]]}
+ self
end
alias_method :each_pair, :each