Class | MusicBrainz::Model::Entity |
In: |
lib/rbrainz/model/entity.rb
|
Parent: | Object |
A first-level MusicBrainz class.
All entities in MusicBrainz have unique IDs (which are MBID‘s representing absolute URIs) and may have any number of relations to other entities. This class is abstract and should not be instantiated.
Relations are differentiated by their target type, that means, where they link to. MusicBrainz currently supports four target types (artists, releases, tracks, and URLs) each identified using a URI. To get all relations with a specific target type, you can use relations and pass one of the following constants as the parameter:
See: | Relation |
id | [R] | The MusicBrainz ID. A MBID containing an absolute URI. |
Returns the entity type of the entity class.
Depending on the class this is :artist, :release, :track or :label.
Returns the entity type of the instance.
Depending on the class this is :artist, :release, :track or :label.
Set the MBID.
mbid should be an instance of MBID or a string representing either a complete MBID URI or just the UUID part of it. If it is a complete URI the entity part of the URI must match the entity type returned by entity_type or an EntityTypeNotMatchingError will be raised.
Raises: UnknownEntityError, InvalidMBIDError, EntityTypeNotMatchingError