Commit 6cfc5795 authored by Jun Hiroe's avatar Jun Hiroe

Add Enumerable#count comment

parent 36836c8e
......@@ -210,6 +210,16 @@ module Enumerable
end
end
##
# call-seq:
# enum.count -> int
# enum.count(item) -> int
# enum.count { |obj| block } -> int
#
# Returns the number of items in +enum+ through enumeration.
# If an argument is given, the number of items in +enum+ that
# are equal to +item+ are counted. If a block is given, it
# counts the number of elements yielding a true value.
def count(v=NONE, &block)
count = 0
if block
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment