Class: ChambaSearchMx::SearchPage
- Inherits:
-
Object
- Object
- ChambaSearchMx::SearchPage
- Defined in:
- lib/chamba_search_mx/search_page.rb
Overview
search landing page
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ SearchPage
constructor
A new instance of SearchPage.
-
#job_urls ⇒ array
Of strings.
- #load(url) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ SearchPage
Returns a new instance of SearchPage.
5 6 7 |
# File 'lib/chamba_search_mx/search_page.rb', line 5 def initialize(opts = {}) @http = opts[:http] || ChambaSearchMx::HTMLPage.new end |
Instance Method Details
#job_urls ⇒ array
Returns of strings.
18 19 20 21 22 |
# File 'lib/chamba_search_mx/search_page.rb', line 18 def job_urls job_elements.map do |job| job.css('.title_modn_sr a').attribute('href').value end end |
#load(url) ⇒ Object
11 12 13 14 |
# File 'lib/chamba_search_mx/search_page.rb', line 11 def load(url) @http.load url self end |