Class: Torkify::Log::LogReader

Inherits:
Object
  • Object
show all
Defined in:
lib/torkify/log/log_reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ LogReader

Returns a new instance of LogReader.



7
8
9
10
# File 'lib/torkify/log/log_reader.rb', line 7

def initialize(stream)
  @stream = stream
  @line = stream.readline
end

Instance Attribute Details

#lineObject

Returns the value of attribute line.



5
6
7
# File 'lib/torkify/log/log_reader.rb', line 5

def line
  @line
end

Instance Method Details

#forwardObject



12
13
14
15
# File 'lib/torkify/log/log_reader.rb', line 12

def forward
  self.line = stream.readline
  self
end

#matcherObject



18
19
20
# File 'lib/torkify/log/log_reader.rb', line 18

def matcher
  @matcher ||= LineMatcher.new(line)
end