Class: NewRelic::Agent::HTTPClients::CurbResponse
- Inherits:
-
Object
- Object
- NewRelic::Agent::HTTPClients::CurbResponse
- Defined in:
- lib/new_relic/agent/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.
42 43 44 45 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 42 def initialize(curlobj) @headers = {} @curlobj = curlobj end |
Instance Method Details
#[](key) ⇒ Object
47 48 49 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 47 def [](key) @headers[ key.downcase ] end |
#append_header_data(data) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 55 def append_header_data( data ) key, value = data.split( /:\s*/, 2 ) @headers[ key.downcase ] = value @curlobj._nr_header_str ||= '' @curlobj._nr_header_str << data end |
#to_hash ⇒ Object
51 52 53 |
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 51 def to_hash @headers.dup end |