Class MusicBrainz::Model::ISRC
In: lib/rbrainz/model/isrc.rb
Parent: Object

Represents an International Standard Recording Code (ISRC).

The International Standard Recording Code or short ISRC is an identification system for audio and music video recordings. It is standarized by the IFPI in ISO 3901:2001 and used by IFPI members to assign unique identifiers to every distinct recording they release.

See:wiki.musicbrainz.org/ISRC

Methods

==   eql?   new   parse   to_s   to_str  

Constants

ISRC_PATTERN = /^([0-9A-Z]{2})-?([0-9A-Z]{3})-?([0-9A-Z]{2})-?([0-9A-Z]{5})$/i

Attributes

country  [R]  2-letter country code according to the ISO 3166-1-Alpha-2 standard.
designation  [R]  Designation code (5 digits)
registrant  [R]  The Registrant Code identifies the entity assigning the Designation Code in an ISRC.
year  [R]  Year of reference (2 digits).

Public Class methods

Create a new ISRC object from the given string.

Raises:InvalidISRCError

Tries to convert obj into an ISRC object.

If obj is an ISRC it is returned. Otherwise a new ISRC object is created by converting obj into a string and parsing it.

Raises:InvalidISRCError

Public Instance methods

==(other)

Alias for eql?

Compares this ISRC with another one.

If other is not of the type ISRC an attempt is made to convert it into one. This may cause an InvalidISRCError to be raised. Please note that comparing an ISRC with a different type of object is usually not commutative.

Raises:InvalidISRCError

Convert this ISRC into a String. Will return the readable version of the ISRC with dashes added, e.g. FR-Z03-91-01231

Convert this ISRC into a String. Will return the 12 character representation of the ISRC without dashes, e.g. FRZ039101231

[Validate]