Class: Rack::Config

Inherits:
Object show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/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

Returns a new instance of Config.



12
13
14
15
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/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/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/config.rb', line 17

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