Class: IndeedCertifications
- Inherits:
-
Object
- Object
- IndeedCertifications
- Includes:
- IndeedUtilities
- Defined in:
- lib/indeed_certifications.rb
Instance Method Summary collapse
-
#cert_description(certification) ⇒ Object
Get description of cert.
-
#cert_end_date(certification) ⇒ Object
Get cert end date.
-
#cert_start_date(certification) ⇒ Object
Get start date for cert validity.
-
#cert_title(certification) ⇒ Object
Get title of cert.
-
#get_certifications ⇒ Object
Return cert info.
-
#initialize(html) ⇒ IndeedCertifications
constructor
A new instance of IndeedCertifications.
Methods included from IndeedUtilities
Constructor Details
#initialize(html) ⇒ IndeedCertifications
Returns a new instance of IndeedCertifications.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/indeed_certifications.rb', line 6 def initialize(html) certifications = html.xpath("//div[contains(concat(' ',normalize-space(@class),' '),' certification-section ')]") @certification_list = Array.new certifications.each do |certification| @certification_list.push({ cert_title: cert_title(certification), cert_description: cert_description(certification), cert_start_date: cert_start_date(certification), cert_end_date: cert_end_date(certification) }) end end |
Instance Method Details
#cert_description(certification) ⇒ Object
Get description of cert
31 32 33 |
# File 'lib/indeed_certifications.rb', line 31 def cert_description(certification) certification.xpath(".//p[@class='certification_description']").text end |
#cert_end_date(certification) ⇒ Object
Get cert end date
41 42 43 |
# File 'lib/indeed_certifications.rb', line 41 def cert_end_date(certification) parse_dates(certification.xpath(".//p[@class='certification_date']").text)[1] end |
#cert_start_date(certification) ⇒ Object
Get start date for cert validity
36 37 38 |
# File 'lib/indeed_certifications.rb', line 36 def cert_start_date(certification) parse_dates(certification.xpath(".//p[@class='certification_date']").text)[0] end |
#cert_title(certification) ⇒ Object
Get title of cert
26 27 28 |
# File 'lib/indeed_certifications.rb', line 26 def cert_title(certification) certification.xpath(".//p[@class='certification_title']").text end |
#get_certifications ⇒ Object
Return cert info
21 22 23 |
# File 'lib/indeed_certifications.rb', line 21 def get_certifications return @certification_list end |