Class: HttpUtilities::Http::Request

Inherits:
Object
  • Object
show all
Includes:
Logger, ProxySupport, UserAgent
Defined in:
lib/http_utilities/http/request.rb

Constant Summary

Constants included from UserAgent

UserAgent::USER_AGENTS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UserAgent

#set_user_agent

Methods included from ProxySupport

#generate_proxy_options, #proxy_model_defined?, #set_credentials, #set_from_array, #set_from_hash, #set_from_object, #set_from_string, #set_proxy_options

Methods included from Logger

#log

Constructor Details

#initialize(interface: nil, proxy: nil, options: {}) ⇒ Request

Returns a new instance of Request.



10
11
12
13
14
15
# File 'lib/http_utilities/http/request.rb', line 10

def initialize(interface: nil, proxy: nil, options: {})
  self.interface  =   interface
  self.proxy      =   proxy
  
  self.set_user_agent(device: options.fetch(:user_agent_device, :desktop))
end

Instance Attribute Details

#interfaceObject

Returns the value of attribute interface.



8
9
10
# File 'lib/http_utilities/http/request.rb', line 8

def interface
  @interface
end

#proxyObject

Returns the value of attribute proxy.



8
9
10
# File 'lib/http_utilities/http/request.rb', line 8

def proxy
  @proxy
end

#user_agentObject

Returns the value of attribute user_agent.



8
9
10
# File 'lib/http_utilities/http/request.rb', line 8

def user_agent
  @user_agent
end