Class: AddressFetcher::Base
- Inherits:
-
Object
- Object
- AddressFetcher::Base
show all
- Defined in:
- lib/address_fetcher/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#agent ⇒ Object
Returns the value of attribute agent.
17
18
19
|
# File 'lib/address_fetcher/base.rb', line 17
def agent
@agent
end
|
#options ⇒ Object
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_agent ⇒ Object
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_fetch ⇒ Object
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
login
do_fetch
end
|
#type ⇒ Object
37
38
39
|
# File 'lib/address_fetcher/base.rb', line 37
def type
self.class.name.split("::").last
end
|