Class: Sovren::Reference
- Inherits:
-
Object
- Object
- Sovren::Reference
- Defined in:
- lib/sovren/reference.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/sovren/reference.rb', line 3 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/sovren/reference.rb', line 3 def name @name end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
3 4 5 |
# File 'lib/sovren/reference.rb', line 3 def phone_number @phone_number end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/sovren/reference.rb', line 3 def title @title end |
Class Method Details
.parse(references) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/sovren/reference.rb', line 5 def self.parse(references) return Array.new if references.nil? result = references.css('Reference').collect do |item| r = Reference.new r.name = item.css('PersonName FormattedName').text r.title = item.css('PositionTitle').text r.email = item.css('ContactMethod InternetEmailAddress').first.text rescue nil r.phone_number = item.css('ContactMethod Telephone FormattedNumber').first.text rescue nil r end result end |