Class: Wellness::Middleware
- Inherits:
-
Object
- Object
- Wellness::Middleware
- Defined in:
- lib/wellness/middleware.rb
Overview
This is to be put into the Rack environment.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, system, options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, system, options = {}) ⇒ Middleware
Returns a new instance of Middleware.
8 9 10 11 12 13 14 15 |
# File 'lib/wellness/middleware.rb', line 8 def initialize(app, system, ={}) @app = app @system = system # Optional arguments @health_status_path = [:status_path] || '/health/status' @health_details_path = [:details_path] || '/health/details' end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/wellness/middleware.rb', line 17 def call(env) case env['PATH_INFO'] when @health_status_path health_status_check when @health_details_path health_details_check else @app.call(env) end end |