class LogMagic::BaseExplainer

Public Class Methods

new() click to toggle source
# File lib/log_magic/explainers/base_explainer.rb, line 5
def initialize
  @persistance_layer = ::LogMagic::PersistanceLayer.new
end

Public Instance Methods

start() click to toggle source
# File lib/log_magic/explainers/base_explainer.rb, line 10
def start
  app = Proc.new do |env|
    @uuid = env['PATH_INFO'][1..-1]
    body = rendered_template

    ['200', {'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s}, [body]]
  end

  Rack::Handler::WEBrick.run app, Port: self.class.port_number,
                                  Logger: WEBrick::Log::new('/tmp/log_magic.log')
end