instance method
many?
Ruby on Rails 2.2.3
Since v2.2.3Signature
many?(&block)
Returns true if the collection has more than 1 element. Functionally equivalent to collection.size > 1. Works with a block too ala 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 103
def many?(&block)
size = block_given? ? select(&block).size : self.size
size > 1
end
Defined in activesupport/lib/active_support/core_ext/enumerable.rb line 103
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Enumerable