Class: Sovren::Education
- Inherits:
-
Object
- Object
- Sovren::Education
- Defined in:
- lib/sovren/education.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#degree_name ⇒ Object
Returns the value of attribute degree_name.
-
#degree_type ⇒ Object
Returns the value of attribute degree_type.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#gpa ⇒ Object
Returns the value of attribute gpa.
-
#gpa_out_of ⇒ Object
Returns the value of attribute gpa_out_of.
-
#graduated ⇒ Object
Returns the value of attribute graduated.
-
#major ⇒ Object
Returns the value of attribute major.
-
#minor ⇒ Object
Returns the value of attribute minor.
-
#school_name ⇒ Object
Returns the value of attribute school_name.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#state ⇒ Object
Returns the value of attribute state.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def country @country end |
#degree_name ⇒ Object
Returns the value of attribute degree_name.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def degree_name @degree_name end |
#degree_type ⇒ Object
Returns the value of attribute degree_type.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def degree_type @degree_type end |
#end_date ⇒ Object
Returns the value of attribute end_date.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def end_date @end_date end |
#gpa ⇒ Object
Returns the value of attribute gpa.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def gpa @gpa end |
#gpa_out_of ⇒ Object
Returns the value of attribute gpa_out_of.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def gpa_out_of @gpa_out_of end |
#graduated ⇒ Object
Returns the value of attribute graduated.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def graduated @graduated end |
#major ⇒ Object
Returns the value of attribute major.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def major @major end |
#minor ⇒ Object
Returns the value of attribute minor.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def minor @minor end |
#school_name ⇒ Object
Returns the value of attribute school_name.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def school_name @school_name end |
#start_date ⇒ Object
Returns the value of attribute start_date.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def start_date @start_date end |
#state ⇒ Object
Returns the value of attribute state.
3 4 5 |
# File 'lib/sovren/education.rb', line 3 def state @state end |
Class Method Details
.parse(education_history) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sovren/education.rb', line 5 def self.parse(education_history) return Array.new if education_history.nil? result = education_history.css('SchoolOrInstitution').collect do |item| e = Education.new e.school_name = item.css('SchoolName').text e.city, e.state, e.country = item.css('PostalAddress Municipality, PostalAddress Region, PostalAddress CountryCode').collect(&:text) e.degree_type = item.css('Degree').first['degreeType'] e.degree_name = item.css('Degree DegreeName').text e.major = item.css('DegreeMajor Name').text e.minor = item.css('DegreeMinor name').text e.gpa = item.css('EducationalMeasure MeasureValue StringValue').text.to_f rescue nil e.gpa_out_of = item.css('EducationalMeasure HighestPossibleValue StringValue').text.to_f rescue nil e.start_date = Date.parse(item.css('DatesOfAttendance StartDate AnyDate').text) rescue nil e.end_date = Date.parse(item.css('DatesOfAttendance EndDate AnyDate').text) rescue nil e.graduated = item.css('Degree DegreeDate AnyDate').text != "" e end result end |
Instance Method Details
#graduated? ⇒ Boolean
25 26 27 |
# File 'lib/sovren/education.rb', line 25 def graduated? !graduated.nil? && graduated end |