Class: NimbleNodes::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/nimble_nodes/middleware.rb

Instance Method Summary collapse

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