Class: OneApm::Support::HTTPClients::CurbResponse
- Inherits:
-
Object
- Object
- OneApm::Support::HTTPClients::CurbResponse
- Defined in:
- lib/one_apm/support/http_clients/curb_wrappers.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #append_header_data(data) ⇒ Object
-
#initialize(curlobj) ⇒ CurbResponse
constructor
A new instance of CurbResponse.
- #to_hash ⇒ Object
Constructor Details
#initialize(curlobj) ⇒ CurbResponse
Returns a new instance of CurbResponse.
40 41 42 43 |
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 40 def initialize(curlobj) @headers = {} @curlobj = curlobj end |
Instance Method Details
#[](key) ⇒ Object
45 46 47 |
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 45 def [](key) @headers[ key.downcase ] end |
#append_header_data(data) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 53 def append_header_data( data ) key, value = data.split( /:\s*/, 2 ) @headers[ key.downcase ] = value @curlobj._oa_header_str ||= '' @curlobj._oa_header_str << data end |
#to_hash ⇒ Object
49 50 51 |
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 49 def to_hash @headers.dup end |