Class: Nehm::Playlist

Inherits:
Object
  • Object
show all
Defined in:
lib/nehm/playlist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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_sObject



14
15
16
# File 'lib/nehm/playlist.rb', line 14

def to_s
  @name
end