Module: Walkman::Commands::Playlist

Defined in:
lib/walkman/commands/playlist.rb

Class Method Summary collapse

Class Method Details

.likeObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/walkman/commands/playlist.rb', line 4

def self.like
  current_song = Walkman.player.current_song
  playlist = Walkman.player.playlist

  if current_song && playlist
    playlist.feedback(:favorite, current_song)
    "Awesome! I'll play more songs like this."
  else
    "No music is playing. Are you hearing things?"
  end
end

.shuffle!Object



16
17
18
19
20
21
22
23
# File 'lib/walkman/commands/playlist.rb', line 16

def self.shuffle!
  if playlist = Walkman.player.playlist
    playlist.shuffle!
    "Shaking things up a bit."
  else
    "No music is queued."
  end
end