Class: Contacts::Contact::Google
- Inherits:
-
Struct
- Object
- Struct
- Contacts::Contact::Google
- Defined in:
- lib/contacts/contact/google.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email
1 2 3 |
# File 'lib/contacts/contact/google.rb', line 1 def email @email end |
#name ⇒ Object
Returns the value of attribute name
1 2 3 |
# File 'lib/contacts/contact/google.rb', line 1 def name @name end |
Class Method Details
.parse(xml) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/contacts/contact/google.rb', line 3 def self.parse xml name = xml.css("title").text email_node = xml.xpath("gd:email").first return nil if email_node.nil? email = email_node['address'] new(email, name) end |