Class: Cardiac::Client::SwitchHeaders
- Inherits:
-
Object
- Object
- Cardiac::Client::SwitchHeaders
- Defined in:
- lib/cardiac/client.rb
Overview
:nodoc:
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, match, switch) ⇒ SwitchHeaders
constructor
A new instance of SwitchHeaders.
Constructor Details
#initialize(app, match, switch) ⇒ SwitchHeaders
Returns a new instance of SwitchHeaders.
32 33 34 |
# File 'lib/cardiac/client.rb', line 32 def initialize(app,match,switch) @app, @match, @switch = app, match, switch end |
Instance Method Details
#call(env) ⇒ Object
36 37 38 39 |
# File 'lib/cardiac/client.rb', line 36 def call(env) status, headers, body = @app.call(env) [status, Hash[ headers.to_a.map{|k,v| [@match===k ? @switch+$' : k, v] }], body] end |