module Rack::Delegate

Constants

VERSION

Attributes

network_error_response[RW]

Public Class Methods

configure(&block) click to toggle source
# File lib/rack/delegate.rb, line 20
def self.configure(&block)
  dispatcher = Dispatcher.configure(&block)

  Struct.new(:app) do
    define_method :call do |env|
      request = Request.new(env)

      if action = dispatcher.dispatch(request)
        action.call(env)
      else
        app.call(env)
      end
    end
  end
end