Class: PryRescue::Rack

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-rescue/rack.rb

Overview

A Rack middleware that wraps each web request in Pry::rescue.

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Rack

Instantiate the middleware

Parameters:


9
10
11
# File 'lib/pry-rescue/rack.rb', line 9

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object

Handle a web request

Parameters:

  • env (Rack::Env)

15
16
17
# File 'lib/pry-rescue/rack.rb', line 15

def call(env)
  Pry::rescue{ @app.call(env) }
end