Class: Rack::Evil

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/contrib/evil.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Evil

Lets you return a response to the client immediately from anywhere ( M V or C ) in the code.



4
5
6
# File 'lib/rack/contrib/evil.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
# File 'lib/rack/contrib/evil.rb', line 8

def call(env)
  catch(:response) { @app.call(env) }
end