Class: Rack::Putty::Middleware
- Inherits:
-
Object
- Object
- Rack::Putty::Middleware
- Defined in:
- lib/rack-putty/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, options = {}) ⇒ Middleware
Returns a new instance of Middleware.
5 6 7 |
# File 'lib/rack-putty/middleware.rb', line 5 def initialize(app, = {}) @app, @options = app, end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/rack-putty/middleware.rb', line 9 def call(env) response = action(env) # Allow middleware to cause stack to end early response.kind_of?(Hash) ? @app.call(env) : response end |