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
23
# File 'lib/wombat/processing/parser.rb', line 20

def initialize
  @mechanize = Mechanize.new
  @mechanize.set_proxy(*Wombat.proxy_args) if Wombat.proxy_args
end

#parse(metadata) ⇒ Object



25
26
27
28
29
# File 'lib/wombat/processing/parser.rb', line 25

def parse()
  @context = parser_for 

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