class Mmtrix::Agent::HTTPClients::TyphoeusHTTPRequest

Public Class Methods

new(request) click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 39
def initialize(request)
  @request = request
  @uri = case request.url
    when ::URI then request.url
    else Mmtrix::Agent::HTTPClients::URIUtil.parse_url(request.url)
    end
end

Public Instance Methods

[](key) click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 59
def [](key)
  return nil unless @request.options && @request.options[:headers]
  @request.options[:headers][key]
end
[]=(key, value) click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 64
def []=(key, value)
  @request.options[:headers] ||= {}
  @request.options[:headers][key] = value
end
host() click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 51
def host
  self['host'] || self['Host'] || @uri.host
end
method() click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 55
def method
  (@request.options[:method] || 'GET').to_s.upcase
end
type() click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 47
def type
  "Typhoeus"
end
uri() click to toggle source
# File lib/mmtrix/agent/http_clients/typhoeus_wrappers.rb, line 69
def uri
  @uri
end