class Crystalforce::Collection

Overview

Lazy-paginating collection for query results. Implements Enumerable and Iterator for automatic pagination.

Included Modules

Defined in:

crystalforce/collection.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(records : Array(JSON::Any), total_size : Int64, done : Bool, next_records_url : String | Nil, client : Client | ToolingClient) #

[View source]

Instance Method Detail

def current_page : Array(JSON::Any) #

[View source]
def done : Bool #

[View source]
def each(&) #

Enumerable - iterate all records across all pages


[View source]
def has_next_page? #

[View source]
def next #

Iterator


[View source]
def next_page : Array(JSON::Any) | Nil #

[View source]
def rewind #

[View source]
def size : Int64 #
Description copied from module Enumerable(JSON::Any)

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4

[View source]
def total_size : Int64 #

[View source]