Sha256: 07ede78b5c9714af12653827ed1a501adb26e2f316cb59ff8f71db6050f151a5

Contents?: true

Size: 409 Bytes

Versions: 26

Compression:

Stored size: 409 Bytes

Contents

module Restforce
  class Collection < Array
    attr_reader :total_size, :next_page_url

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

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

  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
restforce-1.2.0 lib/restforce/collection.rb
restforce-1.1.0 lib/restforce/collection.rb
restforce-1.0.6 lib/restforce/collection.rb
restforce-1.0.5 lib/restforce/collection.rb
restforce-1.0.4 lib/restforce/collection.rb
restforce-1.0.3 lib/restforce/collection.rb
restforce-1.0.2 lib/restforce/collection.rb
restforce-1.0.1 lib/restforce/collection.rb
restforce-1.0.0 lib/restforce/collection.rb
restforce-0.1.10 lib/restforce/collection.rb
restforce-0.1.9 lib/restforce/collection.rb
restforce-0.1.8 lib/restforce/collection.rb
restforce-0.1.7 lib/restforce/collection.rb
restforce-0.1.6 lib/restforce/collection.rb
restforce-0.1.5 lib/restforce/collection.rb
restforce-0.1.4 lib/restforce/collection.rb
restforce-0.1.3 lib/restforce/collection.rb
restforce-0.1.2 lib/restforce/collection.rb
restforce-0.1.1 lib/restforce/collection.rb
restforce-0.1.0 lib/restforce/collection.rb