Class: Sovren::Employment
- Inherits:
-
Object
- Object
- Sovren::Employment
- Defined in:
- lib/sovren/employment.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#current_employer ⇒ Object
Returns the value of attribute current_employer.
-
#description ⇒ Object
Returns the value of attribute description.
-
#division ⇒ Object
Returns the value of attribute division.
-
#employer ⇒ Object
Returns the value of attribute employer.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#state ⇒ Object
Returns the value of attribute state.
-
#title ⇒ Object
Returns the value of attribute title.
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/employment.rb', line 3 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def country @country end |
#current_employer ⇒ Object
Returns the value of attribute current_employer.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def current_employer @current_employer end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def description @description end |
#division ⇒ Object
Returns the value of attribute division.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def division @division end |
#employer ⇒ Object
Returns the value of attribute employer.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def employer @employer end |
#end_date ⇒ Object
Returns the value of attribute end_date.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def end_date @end_date end |
#start_date ⇒ Object
Returns the value of attribute start_date.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def start_date @start_date end |
#state ⇒ Object
Returns the value of attribute state.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def state @state end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/sovren/employment.rb', line 3 def title @title end |
Class Method Details
.parse(employment_history) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sovren/employment.rb', line 5 def self.parse(employment_history) return Array.new if employment_history.nil? result = employment_history.css('EmployerOrg').collect do |item| position = item.css('PositionHistory').first e = Employment.new e.employer = item.css('EmployerOrgName').text e.division = position.css('OrganizationName').text e.division = nil if e.employer == e.division e.city, e.state, e.country = item.css('PositionLocation Municipality, PositionLocation Region, PositionLocation CountryCode').collect(&:text) e.title = position.css('Title').text e.description = position.css('Description').text e.start_date = Date.parse(position.css('StartDate').text) rescue nil e.current_employer = position['currentEmployer'] == "true" e.end_date = e.current_employer ? nil : (Date.parse(position.css('EndDate').text) rescue nil) e end result end |
Instance Method Details
#current_employer? ⇒ Boolean
24 25 26 |
# File 'lib/sovren/employment.rb', line 24 def current_employer? !current_employer.nil? && current_employer end |