Class: IndeedParser
- Inherits:
-
Object
- Object
- IndeedParser
- Defined in:
- lib/indeedparser.rb
Instance Method Summary collapse
-
#get_results_by_job ⇒ Object
Get output.
-
#initialize(html, url, crawler_fields) ⇒ IndeedParser
constructor
A new instance of IndeedParser.
-
#parse ⇒ Object
Parse profile.
Constructor Details
#initialize(html, url, crawler_fields) ⇒ IndeedParser
Returns a new instance of IndeedParser.
7 8 9 10 11 12 |
# File 'lib/indeedparser.rb', line 7 def initialize(html, url, crawler_fields) @html = html @url = url @crawler_fields = crawler_fields parse end |
Instance Method Details
#get_results_by_job ⇒ Object
Get output
24 25 26 27 28 29 30 31 |
# File 'lib/indeedparser.rb', line 24 def get_results_by_job output = Array.new @job_info.each do |job| output.push(job.merge!(@personal_info).merge!(@crawler_fields)) end JSON.pretty_generate(output) end |
#parse ⇒ Object
Parse profile
15 16 17 18 19 20 21 |
# File 'lib/indeedparser.rb', line 15 def parse p = IndeedPersonalInfo.new(@html, @url) @personal_info = p.get_personal_info j = IndeedJobs.new(@html) @job_info = j.get_jobs end |