Class: Nehm::Playlist
- Inherits:
-
Object
- Object
- Nehm::Playlist
- Defined in:
- lib/nehm/playlist.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_track(track_path) ⇒ Object
-
#initialize(name) ⇒ Playlist
constructor
A new instance of Playlist.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Playlist
Returns a new instance of Playlist.
5 6 7 |
# File 'lib/nehm/playlist.rb', line 5 def initialize(name) @name = name.chomp end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/nehm/playlist.rb', line 3 def name @name end |
Instance Method Details
#add_track(track_path) ⇒ Object
9 10 11 12 |
# File 'lib/nehm/playlist.rb', line 9 def add_track(track_path) puts 'Adding to iTunes' AppleScript.add_track_to_playlist(track_path, @name) end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/nehm/playlist.rb', line 14 def to_s @name end |