class Request

Library namespace and abstract base class

Constants

KEYS
METHODS

Public Instance Methods

absolute_uri() click to toggle source

Return absolute uri

@return [String]

@api private

# File lib/request.rb, line 120
def absolute_uri
  "#{root_uri}#{path_info}"
end
absolute_uri_path(path) click to toggle source

Return absolute uri for path

@param [Path]

@return [String]

@api private

# File lib/request.rb, line 132
def absolute_uri_path(path)
  "#{root_uri}#{path}"
end
host_with_port() click to toggle source

Return host with optional port

Only returns port if protocols default port diffes from actual port.

@return [String]

@api private

# File lib/request.rb, line 155
def host_with_port
  uhost, uport = self.host, self.port
  if port != protocol.default_port
    "#{uhost}:#{uport}"
  else
    uhost
  end
end
query_params_hash() click to toggle source

Return query params hash

@return [Hash]

@api private

# File lib/request.rb, line 99
def query_params_hash
  query_params.each_with_object({}) do |(key, value), hash|
    hash[key]=value
  end
end
root_uri() click to toggle source

Return root uri

@return [String]

@api private

# File lib/request.rb, line 142
def root_uri
  "#{protocol.name}://#{host_with_port}"
end
uid() click to toggle source

Return unique id

@return [String]

@api private

# File lib/request.rb, line 28
def uid
  SecureRandom.hex(6)
end