Class: Rack::Log
- Inherits:
-
Object
- Object
- Rack::Log
- Defined in:
- lib/rack/log.rb,
lib/rack/log/version.rb
Constant Summary collapse
- RACK_KEY =
"rack.logger"
- VERSION =
"1.0.0"
Instance Method Summary collapse
- #call(previous_state) ⇒ Object
-
#initialize(stack, logger) ⇒ Log
constructor
A new instance of Log.
Constructor Details
#initialize(stack, logger) ⇒ Log
Returns a new instance of Log.
6 7 8 9 |
# File 'lib/rack/log.rb', line 6 def initialize(stack, logger) @stack = stack @logger = logger end |
Instance Method Details
#call(previous_state) ⇒ Object
11 12 13 14 15 |
# File 'lib/rack/log.rb', line 11 def call(previous_state) @state = previous_state state[RACK_KEY] = @logger stack.call(state) end |