Class: NewRelic::Agent::HTTPClients::ExconHTTPRequest
Constant Summary
collapse
- EXCON =
'Excon'
AbstractRequest::COLON, AbstractRequest::LHOST, AbstractRequest::UHOST
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ExconHTTPRequest.
51
52
53
54
55
56
57
58
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 51
def initialize(datum)
@datum = datum
@method = @datum[:method].to_s.upcase
@scheme = @datum[:scheme]
@port = @datum[:port]
@path = @datum[:path]
end
|
Instance Attribute Details
#method ⇒ Object
Returns the value of attribute method.
47
48
49
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 47
def method
@method
end
|
Instance Method Details
#[](key) ⇒ Object
74
75
76
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 74
def [](key)
[key]
end
|
#[]=(key, value) ⇒ Object
78
79
80
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 78
def []=(key, value)
[key] = value
end
|
87
88
89
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 87
def
@datum[:headers]
end
|
#host ⇒ Object
70
71
72
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 70
def host
|| @datum[:host]
end
|
64
65
66
67
68
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 64
def
if hostname = ([LHOST] || [UHOST])
hostname.split(COLON).first
end
end
|
#type ⇒ Object
60
61
62
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 60
def type
EXCON
end
|
#uri ⇒ Object
82
83
84
85
|
# File 'lib/new_relic/agent/http_clients/excon_wrappers.rb', line 82
def uri
url = "#{@scheme}://#{host}:#{@port}#{@path}"
URIUtil.parse_and_normalize_url(url)
end
|