Class: Ankit::EventTraversingCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ankit/event_traversing_command.rb

Direct Known Subclasses

ScoreCommand

Constant Summary

Constants inherited from Command

Command::COMMANDS

Instance Attribute Summary

Attributes inherited from Command

#args, #options, #runtime

Instance Method Summary collapse

Methods inherited from Command

available, by_name, command_name, define_options, #initialize, option_spec

Constructor Details

This class inherits a constructor from Ankit::Command

Instance Method Details

#each_event(name = nil, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/ankit/event_traversing_command.rb', line 7

def each_event(name=nil, &block)
  runtime.config.journals.each do |j|
    open(j) do |f|
      f.each_line do |line|
        event = Event.parse(line)
        block.call(event) if nil == name or event.name == name
      end
    end
  end
end