Class: Atlantis::Portal::Agent

Inherits:
Mechanize
  • Object
show all
Defined in:
lib/Atlantis/portal/agent.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAgent

Returns a new instance of Agent.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/Atlantis/portal/agent.rb', line 13

def initialize
  super

  self.user_agent_alias = 'Mac Safari'

  self.log ||= Logger.new(STDOUT)
  self.log.level = Logger::ERROR

  if ENV['HTTP_PROXY']
    uri = URI.parse(ENV['HTTP_PROXY'])
    user = ENV['HTTP_PROXY_USER'] if ENV['HTTP_PROXY_USER']
    password = ENV['HTTP_PROXY_PASSWORD'] if ENV['HTTP_PROXY_PASSWORD']

    set_proxy(uri.host, uri.port, user || uri.user, password || uri.password)
  end
end

Instance Attribute Details

#formatObject

Returns the value of attribute format.



11
12
13
# File 'lib/Atlantis/portal/agent.rb', line 11

def format
  @format
end

#serviceObject

Returns the value of attribute service.



11
12
13
# File 'lib/Atlantis/portal/agent.rb', line 11

def service
  @service
end

#service_instanceObject

Returns the value of attribute service_instance.



11
12
13
# File 'lib/Atlantis/portal/agent.rb', line 11

def service_instance
  @service_instance
end