Class: Errplane::Rack
- Inherits:
-
Object
- Object
- Errplane::Rack
- Defined in:
- lib/errplane/rack.rb
Instance Method Summary collapse
- #_call(env) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app) ⇒ Rack
Returns a new instance of Rack.
3 4 5 |
# File 'lib/errplane/rack.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#_call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/errplane/rack.rb', line 11 def _call(env) begin status, headers, body = @app.call(env) rescue => e Errplane.transmit_unless_ignorable(e, env) raise(e) ensure _body = [] body.each { |line| _body << line } unless body.nil? body.close if body.respond_to?(:close) end [status, headers, _body] end |
#call(env) ⇒ Object
7 8 9 |
# File 'lib/errplane/rack.rb', line 7 def call(env) dup._call(env) end |