class Tagregate::Count

Public Class Methods

new(step_mother, io, options) click to toggle source
# File lib/tagregate/count.rb, line 3
def initialize(step_mother, io, options)
  @io = io
  @aggregate = {}
end

Public Instance Methods

after_features(whatever) click to toggle source
# File lib/tagregate/count.rb, line 15
def after_features(whatever)
  keys = @aggregate.keys.sort

  keys.each do |k|
    @io.puts "#{k.ljust(50, " ")} #{@aggregate[k]}"
  end
end
after_tags(tags) click to toggle source
# File lib/tagregate/count.rb, line 8
def after_tags(tags)
  tags.tags.each do |tag|
    @aggregate[tag.name] ||= 0
    @aggregate[tag.name] = @aggregate[tag.name] + 1
  end
end