Module: LogParser::Pattern
- Included in:
- RegExpPattern
- Defined in:
- lib/log_parser/pattern.rb
Overview
Represents a certain pattern log message. The model we use is that
* a pattern tells you if a message starts in a given line, and
* reads lines from there on until it ends.
The result will be a Message.
Instance Method Summary collapse
-
#begins_at?(_line) ⇒ true, false
abstract
Checks if this message pattern matches the given line.
-
#read(_lines) ⇒ Array<(Message, Int)>
abstract
Reads a message from the given lines.
Instance Method Details
permalink #begins_at?(_line) ⇒ true, false
This method is abstract.
Checks if this message pattern matches the given line.
16 17 18 |
# File 'lib/log_parser/pattern.rb', line 16 def begins_at?(_line) raise NotImplementedError end |
permalink #read(_lines) ⇒ Array<(Message, Int)>
This method is abstract.
Reads a message from the given lines.
29 30 31 |
# File 'lib/log_parser/pattern.rb', line 29 def read(_lines) raise NotImplementedError end |