Sha256: c9022fb8da39646c19aa408dcd4e1b26fc984f68b6d6f7bf5821d0c13dba0c0c
Contents?: true
Size: 642 Bytes
Versions: 14
Compression:
Stored size: 642 Bytes
Contents
class Hubspot::PagedCollection < Hubspot::Collection attr_accessor :offset, :limit def initialize(opts = {}, &block) @limit_param = opts.delete(:limit_param) || "limit" @limit = opts.delete(:limit) || 25 @offset_param = opts.delete(:offset_param) || "offset" @offset = opts.delete(:offset) super(opts, &block) end def more? @has_more end def next_offset @next_offset end def next_page? @has_more end def next_page @offset = next_offset fetch self end protected def fetch @resources, @next_offset, @has_more = @fetch_proc.call(@options, @offset, @limit) end end
Version data entries
14 entries across 14 versions & 1 rubygems