From 556204abaf95f7c995576cb1358f13de406682ab Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 12 Jun 2008 17:46:15 -0500 Subject: Added Enumberable#several? to encapsulate collection.size > 1 [DHH] --- activesupport/lib/active_support/core_ext/enumerable.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb index f1469aa0e3..47ff19e963 100644 --- a/activesupport/lib/active_support/core_ext/enumerable.rb +++ b/activesupport/lib/active_support/core_ext/enumerable.rb @@ -66,4 +66,9 @@ module Enumerable accum end end + + # Returns true if the collection has more than 1 element. Functionally equivalent to collection.size > 1. + def several? + size > 1 + end end -- cgit v1.2.3