Class: EasterHeaders::Middleware

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

Instance Method Summary collapse

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, options)
  @app = app
  @options = 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

#keyObject



9
10
11
# File 'lib/easter_headers/middleware.rb', line 9

def key
  @options[:key]
end

#valueObject



13
14
15
# File 'lib/easter_headers/middleware.rb', line 13

def value
  @options[:value]
end