Class: NewRelic::Agent::HTTPClients::ExconHTTPRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/agent/http_clients/excon_wrappers.rb

Instance Method Summary collapse

Constructor Details

#initialize(datum) ⇒ ExconHTTPRequest

Returns a new instance of ExconHTTPRequest.



30
31
32
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 30

def initialize(datum)
  @datum = datum
end

Instance Method Details

#[](key) ⇒ Object



46
47
48
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 46

def [](key)
  @datum[:headers][key]
end

#[]=(key, value) ⇒ Object



50
51
52
53
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 50

def []=(key, value)
  @datum[:headers] ||= {}
  @datum[:headers][key] = value
end

#hostObject



38
39
40
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 38

def host
  @datum[:host]
end

#methodObject



42
43
44
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 42

def method
  @datum[:method].to_s.upcase
end

#typeObject



34
35
36
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 34

def type
  "Excon"
end

#uriObject



55
56
57
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 55

def uri
  URI.parse("#{@datum[:scheme]}://#{@datum[:host]}:#{@datum[:port]}#{@datum[:path]}")
end