Class: Googletastic::Person
- Defined in:
- lib/googletastic/person.rb
Constant Summary
Constants included from Mixins::Namespaces
Mixins::Namespaces::NAMESPACES
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Base
#acl, #attachment_path, #created_at, #etag, #head, #id, #keep_raw, #raw, #response, #synced_with, #updated_at
Attributes included from Mixins::Attributes
Class Method Summary collapse
Methods inherited from Base
Methods included from Mixins::Pagination
Methods included from Mixins::Finders
Methods included from Mixins::Parsing
Methods included from Mixins::Requesting
Methods included from Mixins::Attributes
#attribute_names, #has_attribute?, #inspect
Methods included from Mixins::Namespaces
Constructor Details
This class inherits a constructor from Googletastic::Base
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/googletastic/person.rb', line 3 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/googletastic/person.rb', line 3 def name @name end |
Class Method Details
.client_class ⇒ Object
11 12 13 |
# File 'lib/googletastic/person.rb', line 11 def client_class "Contacts" end |
.index_url ⇒ Object
7 8 9 |
# File 'lib/googletastic/person.rb', line 7 def index_url "http://www.google.com/m8/feeds/contacts/default/full" end |
.unmarshall(xml) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/googletastic/person.rb', line 24 def unmarshall(xml) records = xml.xpath("//atom:entry", ns_tag("atom")).collect do |record| id = record.xpath("atom:id", ns_tag("atom")).first.text name = record.xpath("atom:title", ns_tag("atom")).first.text email = record.xpath("gd:email", ns_tag("gd")).first["address"].to_s Googletastic::Person.new( :id => id, :name => name, :email => email ) end records end |
.valid_queries ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/googletastic/person.rb', line 16 def valid_queries { :order => "orderby", :sort => "sortorder", :group => "group" }.merge(super) end |