module Enumerable def count(obj) t = 0 each { |i| t += 1 if i == obj } return t end end