Class: NewRelic::Agent::HTTPClients::NetHTTPRequest
- Inherits:
-
Object
- Object
- NewRelic::Agent::HTTPClients::NetHTTPRequest
- Defined in:
- lib/new_relic/agent/http_clients/net_http_wrappers.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #host ⇒ Object
-
#initialize(connection, request) ⇒ NetHTTPRequest
constructor
A new instance of NetHTTPRequest.
- #method ⇒ Object
- #type ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(connection, request) ⇒ NetHTTPRequest
Returns a new instance of NetHTTPRequest.
9 10 11 12 |
# File 'lib/new_relic/agent/http_clients/net_http_wrappers.rb', line 9 def initialize(connection, request) @connection = connection @request = request end |
Instance Method Details
#[](key) ⇒ Object
26 27 28 |
# File 'lib/new_relic/agent/http_clients/net_http_wrappers.rb', line 26 def [](key) @request[key] end |
#[]=(key, value) ⇒ Object
30 31 32 |
# File 'lib/new_relic/agent/http_clients/net_http_wrappers.rb', line 30 def []=(key, value) @request[key] = value end |
#host ⇒ Object
18 19 20 |
# File 'lib/new_relic/agent/http_clients/net_http_wrappers.rb', line 18 def host @connection.address end |
#method ⇒ Object
22 23 24 |
# File 'lib/new_relic/agent/http_clients/net_http_wrappers.rb', line 22 def method @request.method end |
#type ⇒ Object
14 15 16 |
# File 'lib/new_relic/agent/http_clients/net_http_wrappers.rb', line 14 def type 'Net::HTTP' end |
#uri ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/new_relic/agent/http_clients/net_http_wrappers.rb', line 34 def uri case @request.path when /^https?:\/\// URI(@request.path) else scheme = @connection.use_ssl? ? 'https' : 'http' URI("#{scheme}://#{@connection.address}:#{@connection.port}#{@request.path}") end end |