Class: Neverland::Middleware
- Inherits:
-
Object
- Object
- Neverland::Middleware
- Defined in:
- lib/neverland/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.
5 6 7 |
# File 'lib/neverland/middleware.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/neverland/middleware.rb', line 9 def call(env) params = ParameterExtractor.extract(env) status, headers, response = @app.call(env) response = ScriptInjector.inject(response, params) [status, headers, response] end |