Class: Log::Analyzer::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/log-analyzer/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



5
6
7
8
9
# File 'lib/log-analyzer/config.rb', line 5

def initialize
  @route_regexp = /(GET|POST|DELETE|PATCH|PUT)\s*([^\s]*)\s*[^\s]*\s*(\{.*\})?\s*(\[.*\])?/i
  @log_regexp = /Started (?<request_method>GET|POST|DELETE|PATCH|PUT) "(?<path_info>[^"]+)".*in (?<response_time>[0-9]+)ms/im
  @log_separator = "\n\n\n"
end

Instance Attribute Details

#log_regexpObject

Returns the value of attribute log_regexp.



3
4
5
# File 'lib/log-analyzer/config.rb', line 3

def log_regexp
  @log_regexp
end

#log_separatorObject

Returns the value of attribute log_separator.



3
4
5
# File 'lib/log-analyzer/config.rb', line 3

def log_separator
  @log_separator
end

#route_regexpObject

Returns the value of attribute route_regexp.



3
4
5
# File 'lib/log-analyzer/config.rb', line 3

def route_regexp
  @route_regexp
end