Class: NimbleNodes::Middleware
- Inherits:
-
Object
- Object
- NimbleNodes::Middleware
- Defined in:
- lib/nimble_nodes/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
3 4 5 |
# File 'lib/nimble_nodes/middleware.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 |
# File 'lib/nimble_nodes/middleware.rb', line 8 def call(env) NimbleNodes::Dynos.monitor(env) if NimbleNodes::Dynos.monitor? # now, execute the request using our Rails app response = @app.call(env) end |