diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-03-03 03:31:57 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-03-03 03:31:57 +0000 |
commit | 42d1172c2d8739ea1f4fd28ab85f97883e79190b (patch) | |
tree | ad1faa90a509ca45672d636eb6cf1a9697df6d43 /activesupport/lib | |
parent | b18585fb06a9eb9f5fa64e53594885f330167ad0 (diff) | |
download | rails-42d1172c2d8739ea1f4fd28ab85f97883e79190b.tar.gz rails-42d1172c2d8739ea1f4fd28ab85f97883e79190b.tar.bz2 rails-42d1172c2d8739ea1f4fd28ab85f97883e79190b.zip |
Add OrderedHash#to_hash. Closes #11266 [josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/ordered_options.rb | 6 |
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 |