Class MusicBrainz::Model::Collection
In: lib/rbrainz/model/collection.rb
Parent: Object

A Collection is a list of models.

A collection object may only store an extract of the complete data available on the server. This is especially the case if the limit or offset filter was used in the query. The collection object makes the total number of elements on the server and the current offset available with the count respective the offset parameter.

Methods

+   <<   []   []=   delete   dup   each   empty?   new   size   to_a   to_ary  

Included Modules

::Enumerable

Attributes

count  [RW]  Returns the total number of elements for that collection on the server.
offset  [RW]  Returns the position at which this collection starts. Used for paging through more than one page of results.

Public Class methods

Create a new collection object.

The count and offset parameters should be set according to the values returned by the server.

Public Instance methods

Create a new collection containing the elements of both collections. Count and offset will be set to nil in the new collection.

Add a new element to this collection. Returns self.

Access a random element in the collection by the element‘s index.

Set a random element in the collection by the element‘s index.

Delete an element from the collection.

Duplicate this collection.

Iterate over the contents of the collection.

Returns true, if the collection contains no elements.

The number of elements in the collection.

Convert the collection into an Array.

to_ary()

Alias for to_a

[Validate]