Class: OneApm::Support::HTTPClients::HTTPClientResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HTTPClientResponse

Returns a new instance of HTTPClientResponse.



9
10
11
# File 'lib/one_apm/support/http_clients/httpclient_wrappers.rb', line 9

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



7
8
9
# File 'lib/one_apm/support/http_clients/httpclient_wrappers.rb', line 7

def response
  @response
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/one_apm/support/http_clients/httpclient_wrappers.rb', line 13

def [](key)
  response.headers.each do |k,v|
    if key.downcase == k.downcase
      return v
    end
  end
  nil
end

#to_hashObject



22
23
24
# File 'lib/one_apm/support/http_clients/httpclient_wrappers.rb', line 22

def to_hash
  response.headers
end