Class: RequestLogAnalyzer::Aggregator::Echo

Inherits:
Base
  • Object
show all
Defined in:
lib/request_log_analyzer/aggregator/echo.rb

Overview

Echo Aggregator. Writes everything passed to it

Instance Attribute Summary

Attributes inherited from Base

#options, #source

Instance Method Summary collapse

Methods inherited from Base

#finalize, #initialize, #source_change

Constructor Details

This class inherits a constructor from RequestLogAnalyzer::Aggregator::Base

Instance Method Details

#aggregate(request) ⇒ Object



10
11
12
# File 'lib/request_log_analyzer/aggregator/echo.rb', line 10

def aggregate(request)
  puts "\nRequest: " + request.inspect
end

#prepareObject



6
7
8
# File 'lib/request_log_analyzer/aggregator/echo.rb', line 6

def prepare
  @warnings = ""
end

#report(output) ⇒ Object



18
19
20
21
# File 'lib/request_log_analyzer/aggregator/echo.rb', line 18

def report(output)
  output.title("Warnings during parsing")
  output.puts @warnings
end

#warning(type, message, lineno) ⇒ Object



14
15
16
# File 'lib/request_log_analyzer/aggregator/echo.rb', line 14

def warning(type, message, lineno)
  @warnings << "WARNING #{type.inspect} on line #{lineno}: #{message}\n"
end