aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-04-02 12:47:52 +0000
committerPratik Naik <pratiknaik@gmail.com>2008-04-02 12:47:52 +0000
commit3b603bbc937ec9647de78fd271347987aea24e09 (patch)
tree093617bbe3cdf1b2338c88a23862ff556fd73198 /activesupport/lib
parentadaed1ebcb4af2a7203d61e70b826f69f880fb2f (diff)
downloadrails-3b603bbc937ec9647de78fd271347987aea24e09.tar.gz
rails-3b603bbc937ec9647de78fd271347987aea24e09.tar.bz2
rails-3b603bbc937ec9647de78fd271347987aea24e09.zip
Revert [9209] Use Hash#except
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/slice.rb16
1 files changed, 0 insertions, 16 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/slice.rb b/activesupport/lib/active_support/core_ext/hash/slice.rb
index c270e3906b..6fe5e05330 100644
--- a/activesupport/lib/active_support/core_ext/hash/slice.rb
+++ b/activesupport/lib/active_support/core_ext/hash/slice.rb
@@ -11,11 +11,6 @@ module ActiveSupport #:nodoc:
# end
#
# search(options.slice(:mass, :velocity, :time))
- #
- # Also allows leaving out certain keys. This is useful when duplicating
- # a hash but omitting a certain subset:
- #
- # Event.new(event.attributes.without(:id, :user_id))
module Slice
# Returns a new hash with only the given keys.
def slice(*keys)
@@ -27,17 +22,6 @@ module ActiveSupport #:nodoc:
def slice!(*keys)
replace(slice(*keys))
end
-
- # Returns a new hash without the given keys.
- def without(*keys)
- allowed = self.keys - (respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys)
- slice(*allowed)
- end
-
- # Replaces the hash without the given keys.
- def without!(*keys)
- replace(without(*keys))
- end
end
end
end