Methods

Files

Tins::CountBy

Public Instance Methods

count_by(&b) click to toggle source
# File lib/tins/count_by.rb, line 3
def count_by(&b)
  b ||= lambda { |x| true }
  inject(0) { |s, e| s += 1 if b[e]; s }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.