Module: Walkman::Commands::Information

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

Class Method Summary collapse

Class Method Details

.now_playingObject



4
5
6
7
8
9
10
# File 'lib/walkman/commands/information.rb', line 4

def self.now_playing
  if song = Walkman.player.current_song
    "♫ Now playing #{song.title} by #{song.artist}"
  else
    "No music is playing"
  end
end

.up_next(count = 5) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/walkman/commands/information.rb', line 12

def self.up_next(count = 5)
  songs = Walkman.player.playlist.queue.take(count)
  songs_string = ""

  songs.each do |song|
    songs_string += "#{song.artist} - #{song.title}\n"
  end

  songs_string
end