Class: LogMagic::BaseRefiner

Inherits:
Object
  • Object
show all
Defined in:
lib/log_magic/refiners/base_refiner.rb

Direct Known Subclasses

MySqlRefiner, SearchkickRefiner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBaseRefiner

Returns a new instance of BaseRefiner.



4
5
6
# File 'lib/log_magic/refiners/base_refiner.rb', line 4

def initialize
  @lines = []
end

Instance Attribute Details

#linesObject

Returns the value of attribute lines.



2
3
4
# File 'lib/log_magic/refiners/base_refiner.rb', line 2

def lines
  @lines
end

Instance Method Details

#matches?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/log_magic/refiners/base_refiner.rb', line 8

def matches?
  lines.last.force_encoding("utf-8") =~ line_match_regex
end

#persistance_layerObject



12
13
14
# File 'lib/log_magic/refiners/base_refiner.rb', line 12

def persistance_layer
  @persistance_layer ||= ::LogMagic::PersistanceLayer.new
end