Mine
public text v1 · immutablemodule Enumerable
# Returns amount of objects in collection matching a yielded
# criteria.
def count
t = 0
each { |i| t += (yield(i)) ? 1 : 0 }
return t
end
end
module Enumerable
# Returns amount of objects in collection matching a yielded
# criteria.
def count
t = 0
each { |i| t += (yield(i)) ? 1 : 0 }
return t
end
end