Class: AFMotion::Rocket::HeaderWrapper
- Inherits:
-
Object
- Object
- AFMotion::Rocket::HeaderWrapper
- Defined in:
- lib/afmotion-rocket/client_patch.rb
Overview
Synchronize headers between clients
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize(source) ⇒ HeaderWrapper
constructor
A new instance of HeaderWrapper.
Constructor Details
#initialize(source) ⇒ HeaderWrapper
Returns a new instance of HeaderWrapper.
32 33 34 |
# File 'lib/afmotion-rocket/client_patch.rb', line 32 def initialize(source) @source = WeakRef.new(source) end |
Instance Method Details
#[](key) ⇒ Object
36 37 38 |
# File 'lib/afmotion-rocket/client_patch.rb', line 36 def [](key) @source.headers_without_wrapper[key] end |
#[]=(key, value) ⇒ Object
40 41 42 43 |
# File 'lib/afmotion-rocket/client_patch.rb', line 40 def []=(key, value) @source.headers_without_wrapper[key] = value @source.rocket_client.requestSerializer.headers[key] = value end |