class OneApm::Support::HTTPClients::ExconHTTPRequest

Public Class Methods

new(datum) click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 28
def initialize(datum)
  @datum = datum
end

Public Instance Methods

[](key) click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 57
def [](key)
  @datum[:headers][key]
end
[]=(key, value) click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 61
def []=(key, value)
  @datum[:headers] ||= {}
  @datum[:headers][key] = value
end
body() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 74
def body
  @datum[:body]
end
host() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 36
def host
  if hostname = (self['host'] || self['Host'])
    hostname.split(':').first
  else
    @datum[:host]
  end
end
method() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 53
def method
  @datum[:method].to_s.upcase
end
params() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 82
def params
  post_params.merge(query)
end
port() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 44
def port
  if hostname = (self['host'] || self['Host'])
    hostname.split(':').last
  else
    @datum[:port]
  end
end
post_params() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 78
def post_params
  body.nil?? {} :  CGI.parse(body)
end
query() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 70
def query
  uri.query.nil?? {} : CGI.parse(uri.query)
end
type() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 32
def type
  "Excon"
end
uri() click to toggle source
# File lib/one_apm/support/http_clients/excon_wrappers.rb, line 66
def uri
  URI.parse("#{@datum[:scheme]}://#{@datum[:host]}:#{@datum[:port]}#{@datum[:path]}")
end