Class: Googletastic::Group

Inherits:
Base
  • Object
show all
Defined in:
lib/googletastic/group.rb

Constant Summary

Constants included from Mixins::Namespaces

Mixins::Namespaces::NAMESPACES

Instance Attribute Summary collapse

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

#attributes

Class Method Summary collapse

Methods inherited from Base

#initialize, #to_xml

Methods included from Mixins::Pagination

included

Methods included from Mixins::Finders

included

Methods included from Mixins::Parsing

included

Methods included from Mixins::Requesting

included

Methods included from Mixins::Attributes

#attribute_names, #has_attribute?, #inspect

Methods included from Mixins::Namespaces

included

Constructor Details

This class inherits a constructor from Googletastic::Base

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/googletastic/group.rb', line 3

def description
  @description
end

#system_groupObject

Returns the value of attribute system_group.



3
4
5
# File 'lib/googletastic/group.rb', line 3

def system_group
  @system_group
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/googletastic/group.rb', line 3

def title
  @title
end

Class Method Details

.client_classObject



11
12
13
# File 'lib/googletastic/group.rb', line 11

def client_class
  "Contacts"
end

.index_urlObject



7
8
9
# File 'lib/googletastic/group.rb', line 7

def index_url
  "http://www.google.com/m8/feeds/groups/default/full"
end

.unmarshall(xml) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/googletastic/group.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
    title         = record.xpath("atom:title", ns_tag("atom")).first.text
    description   = record.xpath("atom:content", ns_tag("atom")).first.text
    system_group  = record.xpath("gContact:systemGroup").first
    system_group  = system_group["id"] unless system_group.nil?
    
    Googletastic::Group.new(
      :id => id,
      :title => title,
      :description => description,
      :system_group => system_group
    )
  end
  records
end

.valid_queriesObject



16
17
18
19
20
21
22
# File 'lib/googletastic/group.rb', line 16

def valid_queries
  {
    :order => "orderby",
    :sort => "sortorder",
    :group => "group"
  }.merge(super)
end