Class: Sovren::Certification

Inherits:
Object
  • Object
show all
Defined in:
lib/sovren/certification.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/sovren/certification.rb', line 3

def description
  @description
end

#effective_dateObject

Returns the value of attribute effective_date.



3
4
5
# File 'lib/sovren/certification.rb', line 3

def effective_date
  @effective_date
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/sovren/certification.rb', line 3

def name
  @name
end

Class Method Details

.parse(certifications) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/sovren/certification.rb', line 5

def self.parse(certifications)
  return Array.new if certifications.nil?
  result = certifications.css('LicenseOrCertification').collect do |item|
    c = Certification.new
    c.name = item.css('Name').text
    c.description = item.css('Description').text
    c.effective_date = Date.parse(item.css('EffectiveDate FirstIssuedDate AnyDate').text) rescue nil
    c
  end
  result
end