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 b2b1b0e438..3172f62f0d 100644
--- a/activesupport/lib/active_support/ordered_options.rb
+++ b/activesupport/lib/active_support/ordered_options.rb
@@ -18,6 +18,12 @@ module ActiveSupport
pair = assoc(key)
pair ? pair.last : nil
end
+
+ def delete(key)
+ pair = assoc(key)
+ pair ? array_index = index(pair) : nil
+ array_index ? delete_at(array_index).last : nil
+ end
def keys
collect { |key, value| key }