Module: Rack::Delegate
- Defined in:
- lib/rack/delegate.rb,
lib/rack/delegate/action.rb,
lib/rack/delegate/version.rb,
lib/rack/delegate/rewriter.rb,
lib/rack/delegate/delegator.rb,
lib/rack/delegate/constraint.rb,
lib/rack/delegate/dispatcher.rb,
lib/rack/delegate/configuration.rb,
lib/rack/delegate/constrained_action.rb,
lib/rack/delegate/network_error_response.rb,
lib/rack/delegate/net_http_request_builder.rb
Defined Under Namespace
Classes: Action, Configuration, ConstrainedAction, Constraint, Delegator, Dispatcher, NetHttpRequestBuilder, NetworkErrorResponse, Rewriter
Constant Summary collapse
- VERSION =
"0.5.0"
Class Attribute Summary collapse
-
.network_error_response ⇒ Object
Returns the value of attribute network_error_response.
Class Method Summary collapse
Class Attribute Details
.network_error_response ⇒ Object
Returns the value of attribute network_error_response.
16 17 18 |
# File 'lib/rack/delegate.rb', line 16 def network_error_response @network_error_response end |
Class Method Details
.configure(&block) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# 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 |