Class: MusicBrainz::Model::Track
- Includes:
- Rateable, Relateable, Taggable
- Defined in:
- lib/rbrainz/model/track.rb
Overview
A track in the MusicBrainz DB.
Constant Summary collapse
- ENTITY_TYPE =
See Entity::ENTITY_TYPE.
:track
Instance Attribute Summary collapse
-
#artist ⇒ Object
The track’s main artist.
-
#duration ⇒ Object
The duration in milliseconds.
-
#isrcs ⇒ Object
readonly
The list of associated ISRCs.
-
#puids ⇒ Object
readonly
The list of associated PUIDs.
-
#releases ⇒ Object
readonly
The releases on which this track appears.
-
#title ⇒ Object
The track’s title.
Attributes included from Rateable
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(id = nil, title = nil) ⇒ Track
constructor
A new instance of Track.
-
#to_s ⇒ Object
Returns the string representation for this track.
Methods included from Taggable
Methods included from Relateable
#add_relation, #get_relations, #relation_target_types
Methods inherited from Entity
Constructor Details
#initialize(id = nil, title = nil) ⇒ Track
Returns a new instance of Track.
48 49 50 51 52 53 54 |
# File 'lib/rbrainz/model/track.rb', line 48 def initialize(id=nil, title=nil) super id self.title = title @puids = Collection.new @isrcs = Collection.new @releases = Collection.new end |
Instance Attribute Details
#artist ⇒ Object
The track’s main artist.
37 38 39 |
# File 'lib/rbrainz/model/track.rb', line 37 def artist @artist end |
#duration ⇒ Object
The duration in milliseconds.
34 35 36 |
# File 'lib/rbrainz/model/track.rb', line 34 def duration @duration end |
#isrcs ⇒ Object (readonly)
The list of associated ISRCs.
43 44 45 |
# File 'lib/rbrainz/model/track.rb', line 43 def isrcs @isrcs end |
#puids ⇒ Object (readonly)
The list of associated PUIDs.
40 41 42 |
# File 'lib/rbrainz/model/track.rb', line 40 def puids @puids end |
#releases ⇒ Object (readonly)
The releases on which this track appears.
46 47 48 |
# File 'lib/rbrainz/model/track.rb', line 46 def releases @releases end |
#title ⇒ Object
The track’s title.
31 32 33 |
# File 'lib/rbrainz/model/track.rb', line 31 def title @title end |
Instance Method Details
#to_s ⇒ Object
Returns the string representation for this track.
Returns #title converted into a string.
59 60 61 |
# File 'lib/rbrainz/model/track.rb', line 59 def to_s title.to_s end |