Class: Apple::Music::Library::Track
- Inherits:
-
Object
- Object
- Apple::Music::Library::Track
- Defined in:
- lib/apple/music/library/track.rb
Constant Summary collapse
- ATTRIBUTES =
['Track ID', 'Name', # 'Artist', The #artist, #album, and #genre methods return objects rather than strings and have methods like #artist_name to retrieve the strings. # 'Album', # 'Genre', 'Kind', 'Size', 'Total Time', 'Track Number', 'Year', 'Date Modified', 'Date Added', 'Bit Rate', 'Sample Rate', 'Play Count', 'Play Date', 'Play Date UTC', 'Rating', 'Album Rating', 'Album Rating Computed', 'Normalization', 'Persistent ID', 'Track Type', 'Location', 'File Folder Count', 'Library Folder Count']
Instance Attribute Summary collapse
-
#album ⇒ Object
readonly
Returns the value of attribute album.
-
#artist ⇒ Object
readonly
Returns the value of attribute artist.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Instance Method Summary collapse
- #album_name ⇒ Object
- #artist_name ⇒ Object
- #genre_name ⇒ Object
- #id ⇒ Object
-
#initialize(info) ⇒ Track
constructor
A new instance of Track.
Constructor Details
Instance Attribute Details
#album ⇒ Object (readonly)
Returns the value of attribute album.
7 8 9 |
# File 'lib/apple/music/library/track.rb', line 7 def album @album end |
#artist ⇒ Object (readonly)
Returns the value of attribute artist.
7 8 9 |
# File 'lib/apple/music/library/track.rb', line 7 def artist @artist end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
7 8 9 |
# File 'lib/apple/music/library/track.rb', line 7 def info @info end |
Instance Method Details
#album_name ⇒ Object
50 51 52 |
# File 'lib/apple/music/library/track.rb', line 50 def album_name info['Album'] end |
#artist_name ⇒ Object
46 47 48 |
# File 'lib/apple/music/library/track.rb', line 46 def artist_name info['Artist'] end |
#genre_name ⇒ Object
54 55 56 |
# File 'lib/apple/music/library/track.rb', line 54 def genre_name info['Genre'] end |
#id ⇒ Object
42 43 44 |
# File 'lib/apple/music/library/track.rb', line 42 def id track_id end |