Class: AddressFetcher::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/address_fetcher/base.rb

Direct Known Subclasses

Aol, Gmail, Hotmail, Yahoo

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#agentObject

Returns the value of attribute agent.



17
18
19
# File 'lib/address_fetcher/base.rb', line 17

def agent
  @agent
end

#optionsObject

Returns the value of attribute options.



16
17
18
# File 'lib/address_fetcher/base.rb', line 16

def options
  @options
end

Instance Method Details

#=~(options) ⇒ Object



19
# File 'lib/address_fetcher/base.rb', line 19

def =~(options); end

#create_agentObject



21
22
23
24
25
26
# File 'lib/address_fetcher/base.rb', line 21

def create_agent
  @agent = WWW::Mechanize.new
  @agent.user_agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9"
  @agent.keep_alive = false
  @agent
end

#do_fetchObject



35
# File 'lib/address_fetcher/base.rb', line 35

def do_fetch; end

#fetch(options) ⇒ Object



28
29
30
31
32
33
# File 'lib/address_fetcher/base.rb', line 28

def fetch(options)
  @options = options
  create_agent
  
  do_fetch
end

#typeObject



37
38
39
# File 'lib/address_fetcher/base.rb', line 37

def type
  self.class.name.split("::").last
end