Sha256: 9fa2303f67b99e7f62e6636ac6e0d483b33b18baf7f20164c6d6dff85602190d

Contents?: true

Size: 410 Bytes

Versions: 110

Compression:

Stored size: 410 Bytes

Contents

# frozen_string_literal: true

module Rack
  # Rack::Config modifies the environment using the block given during
  # initialization.
  #
  # Example:
  #     use Rack::Config do |env|
  #       env['my-key'] = 'some-value'
  #     end
  class Config
    def initialize(app, &block)
      @app = app
      @block = block
    end

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

Version data entries

110 entries across 93 versions & 20 rubygems

Version Path
rack-2.1.3 lib/rack/config.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/rack-2.2.2/lib/rack/config.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/rack-2.2.2/lib/rack/config.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/rack-2.2.2/lib/rack/config.rb
rack-2.2.2 lib/rack/config.rb
rack-2.2.1 lib/rack/config.rb
rack-2.2.0 lib/rack/config.rb
rack-2.1.2 lib/rack/config.rb
rack-2.1.1 lib/rack/config.rb
rack-2.1.0 lib/rack/config.rb