aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/enumerable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/enumerable.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/enumerable.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb
index b11c916f61..d0821a7c68 100644
--- a/activesupport/lib/active_support/core_ext/enumerable.rb
+++ b/activesupport/lib/active_support/core_ext/enumerable.rb
@@ -101,6 +101,11 @@ module Enumerable
size = block_given? ? select(&block).size : self.size
size > 1
end
+
+ # The negative of the Enumerable#include?. Returns true if the collection does not include the object.
+ def exclude?(object)
+ !include?(object)
+ end
end
class Range #:nodoc: