Class: PortableContacts::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/portable_contacts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Collection

Returns a new instance of Collection.



209
210
211
212
213
214
# File 'lib/portable_contacts.rb', line 209

def initialize(data)
  super data["entry"].collect{|e| PortableContacts::Person.new(e) }
  @total_entries=data["totalResults"].to_i
  @per_page=data["itemsPerPage"].to_i
  @start_index=data["startIndex"].to_i
end

Instance Attribute Details

#per_pageObject (readonly)

Returns the value of attribute per_page.



207
208
209
# File 'lib/portable_contacts.rb', line 207

def per_page
  @per_page
end

#start_indexObject (readonly)

Returns the value of attribute start_index.



207
208
209
# File 'lib/portable_contacts.rb', line 207

def start_index
  @start_index
end

#total_entriesObject (readonly)

Returns the value of attribute total_entries.



207
208
209
# File 'lib/portable_contacts.rb', line 207

def total_entries
  @total_entries
end