Class: Mixtape::YoutubePlaylist
- Inherits:
-
Object
- Object
- Mixtape::YoutubePlaylist
- Defined in:
- lib/mixtape/youtube_playlist.rb
Defined Under Namespace
Classes: InvalidSource
Constant Summary collapse
- URL =
"http://youtube.com"
Instance Method Summary collapse
-
#initialize(songs) ⇒ YoutubePlaylist
constructor
A new instance of YoutubePlaylist.
- #url ⇒ Object
Constructor Details
#initialize(songs) ⇒ YoutubePlaylist
Returns a new instance of YoutubePlaylist.
6 7 8 |
# File 'lib/mixtape/youtube_playlist.rb', line 6 def initialize(songs) @songs = songs end |
Instance Method Details
#url ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/mixtape/youtube_playlist.rb', line 10 def url #TODO deal with imposible searches in each source before sending them to youtube #, until then i'll use compact and return less songs ids = @songs.pmap do |song| video_id(song) end.compact playlist_url ids end |