Parent

Class Index [+]

Quicksearch

Rack::RouteExceptions

Constants

ROUTES
PATH_INFO
EXCEPTION

Public Class Methods

new(app) click to toggle source
    # File lib/vendor/route_exceptions.rb, line 17
17:     def initialize(app)
18:       @app = app
19:     end
route(exception, to) click to toggle source
    # File lib/vendor/route_exceptions.rb, line 9
 9:       def route(exception, to)
10:         ROUTES.delete_if{|k,v| k == exception }
11:         ROUTES << [exception, to]
12:       end

Public Instance Methods

[]=(to, env, exception) click to toggle source
Alias for: route
call(env, try_again = true) click to toggle source
    # File lib/vendor/route_exceptions.rb, line 21
21:     def call(env, try_again = true)
22:       @app.call(env)
23:     rescue Exception => exception
24:       raise(exception) unless try_again
25: 
26:       ROUTES.each do |klass, to|
27:         next unless klass === exception
28:         return route(to, env, exception)
29:       end
30: 
31:       raise(exception)
32:     end
route(to, env, exception) click to toggle source
    # File lib/vendor/route_exceptions.rb, line 34
34:     def route(to, env, exception)
35:       env.merge!(
36:         PATH_INFO   => env['PATH_INFO'],
37:         EXCEPTION   => exception,
38:         'PATH_INFO' => to)
39:       call(env, try_again = false)
40:     end
Also aliased as: []=

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.