Class: Rack::App::Endpoint::Catcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/app/endpoint/catcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, endpoint_properties) ⇒ Catcher

Returns a new instance of Catcher.



3
4
5
6
# File 'lib/rack/app/endpoint/catcher.rb', line 3

def initialize(app, endpoint_properties)
  @app = app
  @endpoint_properties = endpoint_properties
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/rack/app/endpoint/catcher.rb', line 8

def call(env)
  resp = handle_rack_response do
    handle_response_body(env) do
      @app.call(env)
    end
  end
  return resp.finish if resp.is_a?(Rack::Response)

  resp
end