Change Enumberal#several? to Enumberal#many?

This commit is contained in:
David Heinemeier Hansson
2008-06-13 17:34:17 -05:00
parent eea4fe4c90
commit ba0f38f89e
3 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,7 @@
* Added Object#present? which is equivalent to !Object#blank? [DHH]
* Added Enumberable#several? to encapsulate collection.size > 1 [DHH]
* Added Enumberable#many? to encapsulate collection.size > 1 [DHH]
* Add more standard Hash methods to ActiveSupport::OrderedHash [Steve Purcell]

View File

@@ -79,7 +79,7 @@ module Enumerable
end
# Returns true if the collection has more than 1 element. Functionally equivalent to collection.size > 1.
def several?
def many?
size > 1
end
end

View File

@@ -65,8 +65,8 @@ class EnumerableTests < Test::Unit::TestCase
end
def test_several
assert ![].several?
assert ![ 1 ].several?
assert [ 1, 2 ].several?
assert ![].many?
assert ![ 1 ].many?
assert [ 1, 2 ].many?
end
end