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