From 9984266c041e1079a09140f9307fc1ca13858988 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Sat, 3 Sep 2011 14:43:33 +0700 Subject: Make `ActiveSupport::OrderedHash` extractable when using `Array#extract_options!` `ActiveSupport::OrderedHash` is actually a subclass of the hash, so it does make sense that it should be extractable from the array list. --- activesupport/lib/active_support/ordered_hash.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/lib/active_support/ordered_hash.rb') diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb index 7f70628933..0264133581 100644 --- a/activesupport/lib/active_support/ordered_hash.rb +++ b/activesupport/lib/active_support/ordered_hash.rb @@ -47,6 +47,11 @@ module ActiveSupport self end + # Returns true to make sure that this hash is extractable via Array#extract_options! + def extractable_options? + true + end + # Hash is ordered in Ruby 1.9! if RUBY_VERSION < '1.9' -- cgit v1.2.3 From 8cae31c800f281212c9c5b5ac0ea2be98c4aa611 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Tue, 22 Nov 2011 17:12:37 +0530 Subject: remove nodoc on OrderedHash --- activesupport/lib/active_support/ordered_hash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/ordered_hash.rb') diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb index 0264133581..b0d4f2bd86 100644 --- a/activesupport/lib/active_support/ordered_hash.rb +++ b/activesupport/lib/active_support/ordered_hash.rb @@ -20,7 +20,7 @@ module ActiveSupport # oh.keys # => [:a, :b], this order is guaranteed # # ActiveSupport::OrderedHash is namespaced to prevent conflicts with other implementations. - class OrderedHash < ::Hash #:nodoc: + class OrderedHash < ::Hash def to_yaml_type "!tag:yaml.org,2002:omap" end -- cgit v1.2.3