Class: GoogleContactsApi::Group

Inherits:
Result
  • Object
show all
Includes:
Contacts
Defined in:
lib/google_contacts_api/group.rb

Instance Attribute Summary

Attributes inherited from Result

#api

Instance Method Summary collapse

Methods inherited from Result

#categories, #content, #deleted?, #etag, #id, #initialize, #inspect, #title, #updated

Constructor Details

This class inherits a constructor from GoogleContactsApi::Result

Instance Method Details

#contacts(params = {}) ⇒ Object



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

def contacts(params = {})
  # contacts in this group
  @contacts ||= super({"group" => self.id}.merge(params))
end

#contacts!(params = {}) ⇒ Object



16
17
18
19
# File 'lib/google_contacts_api/group.rb', line 16

def contacts!(params = {})
  # contacts in this group
  @contacts = super({"group" => self.id}.merge(params))
end


31
32
33
34
# File 'lib/google_contacts_api/group.rb', line 31

def edit_link
  _link = self["link"].find { |l| l.rel == "edit" }
  _link ? _link.href : nil
end

Returns the array of links, as link is an array for Hashie.



22
23
24
# File 'lib/google_contacts_api/group.rb', line 22

def links
  self["link"].map { |l| l.href }
end


26
27
28
29
# File 'lib/google_contacts_api/group.rb', line 26

def self_link
  _link = self["link"].find { |l| l.rel == "self" }
  _link ? _link.href : nil
end

#system_group?Boolean

Populate from a single entry element in the result response when requesting a set of Contacts

Returns:

  • (Boolean)


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

def system_group?
  !self["gContact$systemGroup"].nil?
end