Class: Restforce::Collection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, client) ⇒ Collection

Returns a new instance of Collection.



5
6
7
8
9
10
# File 'lib/restforce/collection.rb', line 5

def initialize(hash, client)
  @client        = client
  @total_size    = hash['totalSize']
  @next_page_url = hash['nextRecordsUrl']
  super(Restforce::Mash.build(hash['records'], @client))
end

Instance Attribute Details

#next_page_urlObject (readonly)

Returns the value of attribute next_page_url.



3
4
5
# File 'lib/restforce/collection.rb', line 3

def next_page_url
  @next_page_url
end

#total_sizeObject (readonly)

Returns the value of attribute total_size.



3
4
5
# File 'lib/restforce/collection.rb', line 3

def total_size
  @total_size
end

Instance Method Details

#next_pageObject



12
13
14
15
# File 'lib/restforce/collection.rb', line 12

def next_page
  response = @client.get next_page_url
  response.body
end