class StackifyRubyAPM::Context::Request::Url

@api private

Constants

SKIPPED_PORTS

Attributes

full[R]
hash[R]
hostname[R]
pathname[R]
port[R]
protocol[R]

Public Class Methods

new(req) click to toggle source
# File lib/stackify_apm/context/request/url.rb, line 17
def initialize(req)
  @protocol = req.scheme
  @hostname = req.host
  @port = req.port.to_s
  @pathname = req.path
  @search = req.query_string
  @hash = nil
  @full = build_full_url req
end

Private Instance Methods

build_full_url(req) click to toggle source
# File lib/stackify_apm/context/request/url.rb, line 32
def build_full_url(req)
  url = "#{req.scheme}://#{req.host}"
  url += ":#{req.port}" if req.port != SKIPPED_PORTS[req.scheme]
  url + req.fullpath
end