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.
60 61 62 63 |
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 60 def initialize(curlobj) @headers = {} @curlobj = curlobj end |
Instance Method Details
#[](key) ⇒ Object
65 66 67 |
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 65 def [](key) @headers[ key.downcase ] end |
#append_header_data(data) ⇒ Object
73 74 75 76 77 78 |
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 73 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
69 70 71 |
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 69 def to_hash @headers.dup end |