aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/ordered_options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/ordered_options.rb')
-rw-r--r--activesupport/lib/active_support/ordered_options.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb
index 1542a2479e..b2b1b0e438 100644
--- a/activesupport/lib/active_support/ordered_options.rb
+++ b/activesupport/lib/active_support/ordered_options.rb
@@ -26,6 +26,12 @@ module ActiveSupport
def values
collect { |key, value| value }
end
+
+ def to_hash
+ returning({}) do |hash|
+ each { |array| hash[array[0]] = array[1] }
+ end
+ end
end
end
end