class NewRelic::Agent::HTTPClients::NetHTTPRequest

Public Class Methods

new(connection, request) click to toggle source
# File lib/new_relic/agent/http_clients/net_http_wrappers.rb, line 8
def initialize(connection, request)
  @connection = connection
  @request = request
end

Public Instance Methods

[](key) click to toggle source
# File lib/new_relic/agent/http_clients/net_http_wrappers.rb, line 29
def [](key)
  @request[key]
end
[]=(key, value) click to toggle source
# File lib/new_relic/agent/http_clients/net_http_wrappers.rb, line 33
def []=(key, value)
  @request[key] = value
end
host() click to toggle source
# File lib/new_relic/agent/http_clients/net_http_wrappers.rb, line 17
def host
  if hostname = self['host']
    hostname.split(':').first
  else
    @connection.address
  end
end
method() click to toggle source
# File lib/new_relic/agent/http_clients/net_http_wrappers.rb, line 25
def method
  @request.method
end
type() click to toggle source
# File lib/new_relic/agent/http_clients/net_http_wrappers.rb, line 13
def type
  'Net::HTTP'
end
uri() click to toggle source
# File lib/new_relic/agent/http_clients/net_http_wrappers.rb, line 37
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