Class: EasterHeaders::Middleware
- Inherits:
-
Object
- Object
- EasterHeaders::Middleware
- Defined in:
- lib/easter_headers/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options) ⇒ Middleware
constructor
A new instance of Middleware.
- #key ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(app, options) ⇒ Middleware
Returns a new instance of Middleware.
4 5 6 7 |
# File 'lib/easter_headers/middleware.rb', line 4 def initialize(app, ) @app = app @options = end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/easter_headers/middleware.rb', line 17 def call(env) status, headers, response = @app.call(env) headers[key] = value [status, headers, response] end |
#key ⇒ Object
9 10 11 |
# File 'lib/easter_headers/middleware.rb', line 9 def key @options[:key] end |
#value ⇒ Object
13 14 15 |
# File 'lib/easter_headers/middleware.rb', line 13 def value @options[:value] end |