Class: Play::Artist

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/play/artist.rb

Instance Method Summary collapse

Instance Method Details

#enqueue!(user) ⇒ Object

Queue up an artist. This will grab ten random tracks for this artist and queue ‘em up.

user - the User who is requesting the artist be queued

Returns nothing.



13
14
15
16
17
18
# File 'lib/play/artist.rb', line 13

def enqueue!(user)
  songs.shuffle[0..9].collect do |song|
    song.enqueue!(user)
    song
  end
end