Class: OneApm::Support::HTTPClients::CurbResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/one_apm/support/http_clients/curb_wrappers.rb

Instance Method Summary collapse

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_hashObject



69
70
71
# File 'lib/one_apm/support/http_clients/curb_wrappers.rb', line 69

def to_hash
  @headers.dup
end