Class: NewRelic::Agent::HTTPClients::CurbResponse
Instance Method Summary
collapse
#has_status_code?, #status_code
Constructor Details
#initialize(wrapped_response) ⇒ CurbResponse
Returns a new instance of CurbResponse.
51
52
53
54
|
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 51
def initialize(wrapped_response)
super(wrapped_response)
@headers = {}
end
|
Instance Method Details
#[](key) ⇒ Object
56
57
58
|
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 56
def [](key)
@headers[key.downcase]
end
|
64
65
66
67
68
69
|
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 64
def (data)
key, value = data.split(/:\s*/, 2)
@headers[key.downcase] = value
@wrapped_response. ||= +''
@wrapped_response. << data
end
|
#to_hash ⇒ Object
60
61
62
|
# File 'lib/new_relic/agent/http_clients/curb_wrappers.rb', line 60
def to_hash
@headers.dup
end
|