Class: GoogleContactsApi::GroupSet

Inherits:
ResultSet
  • Object
show all
Defined in:
lib/google_contacts_api/group_set.rb

Instance Attribute Summary

Attributes inherited from ResultSet

#api, #items_per_page, #parsed, #start_index, #total_results

Instance Method Summary collapse

Methods inherited from ResultSet

#each, #has_more?, #inspect

Constructor Details

#initialize(response_body, api = nil) ⇒ GroupSet

Initialize a GroupSet from an API response body that contains groups data



4
5
6
7
8
9
10
11
# File 'lib/google_contacts_api/group_set.rb', line 4

def initialize(response_body, api = nil)
  super
  if @parsed.nil? || @parsed.feed.nil? || @parsed.feed.entry.nil?
    @results = []
  else
    @results = @parsed.feed.entry.map { |e| GoogleContactsApi::Group.new(e, nil, api) }
  end
end