From afc9a8256741bfd7a3ff5c5d60b9135dace80f29 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 29 Jul 2016 14:45:20 -0700 Subject: Revert "Adds `not_in?` onto Object" --- activesupport/lib/active_support/core_ext/object.rb | 1 - .../lib/active_support/core_ext/object/exclusion.rb | 15 --------------- 2 files changed, 16 deletions(-) delete mode 100644 activesupport/lib/active_support/core_ext/object/exclusion.rb (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/object.rb b/activesupport/lib/active_support/core_ext/object.rb index a2c5a472f5..f4f9152d6a 100644 --- a/activesupport/lib/active_support/core_ext/object.rb +++ b/activesupport/lib/active_support/core_ext/object.rb @@ -4,7 +4,6 @@ require 'active_support/core_ext/object/duplicable' require 'active_support/core_ext/object/deep_dup' require 'active_support/core_ext/object/try' require 'active_support/core_ext/object/inclusion' -require 'active_support/core_ext/object/exclusion' require 'active_support/core_ext/object/conversions' require 'active_support/core_ext/object/instance_variables' diff --git a/activesupport/lib/active_support/core_ext/object/exclusion.rb b/activesupport/lib/active_support/core_ext/object/exclusion.rb deleted file mode 100644 index 58dfb649e5..0000000000 --- a/activesupport/lib/active_support/core_ext/object/exclusion.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Object - # Returns true if this object is excluded in the argument. Argument must be - # any object which responds to +#include?+. Usage: - # - # characters = ["Konata", "Kagami", "Tsukasa"] - # "MoshiMoshi".not_in?(characters) # => true - # - # This will throw an +ArgumentError+ if the argument doesn't respond - # to +#include?+. - def not_in?(another_object) - !another_object.include?(self) - rescue NoMethodError - raise ArgumentError.new("The parameter passed to #not_in? must respond to #include?") - end -end \ No newline at end of file -- cgit v1.2.3