Class: Vnehm::Playlist
- Inherits:
-
Object
- Object
- Vnehm::Playlist
- Defined in:
- lib/vnehm/playlist.rb
Overview
iTunes playlist primitive
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_track(track) ⇒ Object
-
#initialize(name) ⇒ Playlist
constructor
A new instance of Playlist.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Playlist
Returns a new instance of Playlist.
10 11 12 |
# File 'lib/vnehm/playlist.rb', line 10 def initialize(name) @name = name.chomp end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/vnehm/playlist.rb', line 8 def name @name end |
Instance Method Details
#add_track(track) ⇒ Object
14 15 16 17 |
# File 'lib/vnehm/playlist.rb', line 14 def add_track(track) UI.say 'Adding to iTunes' AppleScript.add_track_to_playlist(track.file_path, @name) end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/vnehm/playlist.rb', line 19 def to_s @name end |