Class: Pancake::Middlewares::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/pancake/middlewares/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Logger

Returns a new instance of Logger.



6
7
8
# File 'lib/pancake/middlewares/logger.rb', line 6

def initialize(app)
  @app = app
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



5
6
7
# File 'lib/pancake/middlewares/logger.rb', line 5

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
# File 'lib/pancake/middlewares/logger.rb', line 10

def call(env)
  env[Pancake::Constants::ENV_LOGGER_KEY] ||= Pancake.logger
  @app.call(env)
end