Class: Tagregate::Count
- Inherits:
-
Object
- Object
- Tagregate::Count
- Defined in:
- lib/tagregate/count.rb
Instance Method Summary collapse
- #after_features(whatever) ⇒ Object
- #after_tags(tags) ⇒ Object
-
#initialize(step_mother, io, options) ⇒ Count
constructor
A new instance of Count.
Constructor Details
#initialize(step_mother, io, options) ⇒ Count
Returns a new instance of Count.
3 4 5 6 |
# File 'lib/tagregate/count.rb', line 3 def initialize(step_mother, io, ) @io = io @aggregate = {} end |
Instance Method Details
#after_features(whatever) ⇒ Object
15 16 17 18 19 20 21 |
# 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) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/tagregate/count.rb', line 8 def () ..each do |tag| @aggregate[tag.name] ||= 0 @aggregate[tag.name] = @aggregate[tag.name] + 1 end end |