Module: Wombat::Processing::Parser

Included in:
Crawler
Defined in:
lib/wombat/processing/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context.



18
19
20
# File 'lib/wombat/processing/parser.rb', line 18

def context
  @context
end

#mechanizeObject

Returns the value of attribute mechanize.



18
19
20
# File 'lib/wombat/processing/parser.rb', line 18

def mechanize
  @mechanize
end

#pageObject

Returns the value of attribute page.



18
19
20
# File 'lib/wombat/processing/parser.rb', line 18

def page
  @page
end

#response_codeObject

Returns the value of attribute response_code.



18
19
20
# File 'lib/wombat/processing/parser.rb', line 18

def response_code
  @response_code
end

Instance Method Details

#initializeObject



20
21
22
# File 'lib/wombat/processing/parser.rb', line 20

def initialize
  @mechanize = Mechanize.new
end

#parse(metadata) ⇒ Object



28
29
30
31
32
# File 'lib/wombat/processing/parser.rb', line 28

def parse()
  @context = parser_for 

  Wombat::Property::Locators::Factory.locator_for().locate(@context, @mechanize)
end

#set_proxy(host, port) ⇒ Object



24
25
26
# File 'lib/wombat/processing/parser.rb', line 24

def set_proxy(host, port)
	@mechanize.set_proxy host, port
end