123456789_123456789_123456789_123456789_123456789_

Class: Rack::Config

Relationships & Source Files
Inherits: Object
Defined in: lib/rack/config.rb

Overview

Config modifies the environment using the block given during initialization.

Example:

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

Class Method Summary

Instance Method Summary

Constructor Details

.new(app, &block) ⇒ Config

[ GitHub ]

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

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

Instance Method Details

#call(env)

[ GitHub ]

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

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