Class: Vnehm::Playlist

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

Overview

iTunes playlist primitive

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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



19
20
21
# File 'lib/vnehm/playlist.rb', line 19

def to_s
  @name
end