Class: RapSongs::Song

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.playObject



22
23
24
25
# File 'lib/rap_songs.rb', line 22

def self.play
  song = Song.new
  song.open_in_browser
end

Instance Method Details

#open_in_browserObject



27
28
29
# File 'lib/rap_songs.rb', line 27

def open_in_browser
  Launchy.open(random_song)
end

#random_songObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rap_songs.rb', line 9

def random_song
 ["https://www.youtube.com/watch?v=ElOo0psAs3E",
  "https://www.youtube.com/watch?v=u7Fw8OHnJZM",
  "https://www.youtube.com/watch?v=mVFKMomXMOc",
  "https://www.youtube.com/watch?v=v5ybdpttu40",
  "https://www.youtube.com/watch?v=pmdI9YdLQ_o",
  "https://youtu.be/yL9bRzwk0Ds",
  "https://youtu.be/87VaeIKXV1s",
  "https://youtu.be/myrXQebr488",
  "https://www.youtube.com/watch?v=8UhshSef0zs",
  ].sample
end