Class: Rack::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/config.rb

Overview

Rack::Config modifies the environment using the block given during initialization.

Example:

use Rack::Config do |env|
  env['my-key'] = 'some-value'
end

Instance Method Summary collapse

Constructor Details

#initialize(app, &block) ⇒ Config


12
13
14
15
# File 'lib/rack/config.rb', line 12

def initialize(app, &block)
  @app = app
  @block = block
end

Instance Method Details

#call(env) ⇒ Object


17
18
19
20
# File 'lib/rack/config.rb', line 17

def call(env)
  @block.call(env)
  @app.call(env)
end