Class | DataMapper::ChunkedQuery::Chunks |
In: |
lib/dm-chunked_query/chunks.rb
|
Parent: | Object |
Represents the abstract collection of Chunks.
per_chunk | [R] | The number of resources per chunk |
Provides random access to chunks.
@param [Range<Integer>, Integer] key
The index or range of indices to access.
@return [DataMapper::Collection]
A collection of resources at the given index or indices.
Accesses a chunk at a specific index.
@param [to_i] index
The index to access.
@return [DataMapper::Collection]
The chunk of resources at the given index.
Counts how many underlying resources are available.
@return [Integer]
The total number of resources.
Returns the first chunk(s).
@param [Integer] n
The number of sub-chunks to include.
@return [DataMapper::Collection]
The first chunk of resources.
@raise [ArgumentError]
The number of sub-chunks was negative.
@since 0.2.0