Class: Hypertube::Utils::ConnectionData
- Inherits:
-
Object
- Object
- Hypertube::Utils::ConnectionData
show all
- Defined in:
- lib/hypertube-ruby-sdk/utils/connection_data.rb
Constant Summary
collapse
:hypertube_connection_data_thread_local_headers
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ConnectionData.
8
9
10
|
# File 'lib/hypertube-ruby-sdk/utils/connection_data.rb', line 8
def initialize
@headers = {}
end
|
Instance Method Details
12
13
14
15
16
17
18
|
# File 'lib/hypertube-ruby-sdk/utils/connection_data.rb', line 12
def
combined = @headers.dup
.each do |key, value|
combined[key] = value
end
combined
end
|
30
31
32
|
# File 'lib/hypertube-ruby-sdk/utils/connection_data.rb', line 30
def
(Thread.current[THREAD_LOCAL_HEADERS_KEY] || {}).dup
end
|
22
23
24
|
# File 'lib/hypertube-ruby-sdk/utils/connection_data.rb', line 22
def ()
@headers = ()
end
|
26
27
28
|
# File 'lib/hypertube-ruby-sdk/utils/connection_data.rb', line 26
def ()
Thread.current[THREAD_LOCAL_HEADERS_KEY] = ()
end
|
#to_canonical_key ⇒ Object
34
35
36
37
38
39
|
# File 'lib/hypertube-ruby-sdk/utils/connection_data.rb', line 34
def to_canonical_key
key = to_s
return key if .empty?
"#{key}|h:#{}"
end
|