Class: LogfileInterval::ParsedLine::Base
- Inherits:
-
Object
- Object
- LogfileInterval::ParsedLine::Base
- Extended by:
- Parser
- Defined in:
- lib/logfile_interval/parsed_line/base.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes included from Parser
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(line) ⇒ Base
constructor
A new instance of Base.
- #time ⇒ Object
- #valid? ⇒ Boolean
Methods included from Parser
add_column, columns, create_record, each, parse, set_column_custom_options, set_regex
Constructor Details
#initialize(line) ⇒ Base
Returns a new instance of Base.
10 11 12 13 |
# File 'lib/logfile_interval/parsed_line/base.rb', line 10 def initialize(line) @data = self.class.parse(line) @valid = @data ? true : false end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/logfile_interval/parsed_line/base.rb', line 6 def data @data end |
Instance Method Details
#[](name) ⇒ Object
23 24 25 |
# File 'lib/logfile_interval/parsed_line/base.rb', line 23 def [](name) @data[name] end |
#time ⇒ Object
19 20 21 |
# File 'lib/logfile_interval/parsed_line/base.rb', line 19 def time raise NotImplemented end |
#valid? ⇒ Boolean
15 16 17 |
# File 'lib/logfile_interval/parsed_line/base.rb', line 15 def valid? @valid end |