Class: Rack::Robustness

Inherits:
Object
  • Object
show all
Extended by:
DSL
Defined in:
lib/rack/robustness.rb

Defined Under Namespace

Modules: DSL

Constant Summary collapse

VERSION =
"1.1.0".freeze

Constants included from DSL

DSL::NIL_HANDLER

Instance Attribute Summary

Attributes included from DSL

#body_clause, #catch_all, #ensure_clauses, #headers_clause, #rescue_clauses, #response_builder, #status_clause

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DSL

body, content_type, ensure, headers, inherited, install, no_catch_all, rescue, reset, status

Constructor Details

#initialize(app) ⇒ Robustness

Returns a new instance of Robustness.



87
88
89
# File 'lib/rack/robustness.rb', line 87

def initialize(app)
  @app = app
end

Class Method Details

.new(app, &bl) ⇒ Object



6
7
8
9
# File 'lib/rack/robustness.rb', line 6

def self.new(app, &bl)
  return super(app) if bl.nil? and not(Robustness==self)
  Class.new(self).install(&bl).new(app)
end

Instance Method Details

#call(env) ⇒ Object

Rack’s call



94
95
96
97
98
# File 'lib/rack/robustness.rb', line 94

def call(env)
  dup.call!(env)
rescue => ex
   catch_all ? last_resort(ex) : raise(ex)
end