Class: Igotjokes::Logs

Inherits:
Object
  • Object
show all
Defined in:
lib/igotjokes/logs.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Logs

Returns a new instance of Logs.



6
7
8
9
# File 'lib/igotjokes/logs.rb', line 6

def initialize(app)
  @app = app
  @logger = Logger.new(STDOUT)
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
# File 'lib/igotjokes/logs.rb', line 11

def call(env)
  on_request('request', env)
  @app.call(env).on_complete do
    on_response('response', env)
  end
end