instance method
many?
Ruby on Rails 3.1.12
Since v2.2.3Signature
many?(&block)
Returns true if the collection has more than 1 element. Functionally equivalent to collection.size > 1. Can be called with a block too, much like any?, so people.many? { |p| p.age > 26 } returns true if more than 1 person is over 26.
Parameters
-
blockblock
Source
# File activesupport/lib/active_support/core_ext/enumerable.rb, line 98
def many?(&block)
size = block_given? ? count(&block) : self.size
size > 1
end
Defined in activesupport/lib/active_support/core_ext/enumerable.rb line 98
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Enumerable