Class: MCLib::LogParser

Inherits:
Object
  • Object
show all
Defined in:
lib/mclib/log_parser.rb

Instance Method Summary collapse

Constructor Details

#initializeLogParser

Returns a new instance of LogParser.



7
8
9
# File 'lib/mclib/log_parser.rb', line 7

def initialize
  @factory = MCLib::EventFactory.new
end

Instance Method Details

#parse(line) ⇒ Object



11
12
13
14
15
# File 'lib/mclib/log_parser.rb', line 11

def parse(line)
  , message = split_data line
  type = type? 
  @factory.build message, , type
end