Class: LogfileInterval::ParsedLine::Base

Inherits:
Object
  • Object
show all
Extended by:
Parser
Defined in:
lib/logfile_interval/parsed_line/base.rb

Instance Attribute Summary collapse

Attributes included from Parser

#regex

Instance Method Summary collapse

Methods included from Parser

add_column, columns, create_record, each, parse, set_column_custom_options, set_regex, skip, skip_columns, skip_columns_with_exceptions, skip_with_exceptions

Constructor Details

#initialize(line) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
15
# File 'lib/logfile_interval/parsed_line/base.rb', line 10

def initialize(line)
  @data = self.class.parse(line)
  @valid = @data ? true : false
  @skip = @data ? @data[:skip] : false
  @skip_with_exceptions = @data ? @data[:skip_with_exceptions] : false
end

Instance Attribute Details

#dataObject (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



33
34
35
# File 'lib/logfile_interval/parsed_line/base.rb', line 33

def [](name)
  @data[name]
end

#skip?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/logfile_interval/parsed_line/base.rb', line 21

def skip?
  @skip
end

#skip_with_exceptions?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/logfile_interval/parsed_line/base.rb', line 25

def skip_with_exceptions?
  @skip_with_exceptions
end

#timeObject

Raises:

  • (NotImplemented)


29
30
31
# File 'lib/logfile_interval/parsed_line/base.rb', line 29

def time
  raise NotImplemented
end

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/logfile_interval/parsed_line/base.rb', line 17

def valid?
  @valid
end