Class: YouTube::YouTubePlaylist

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

Overview

Playlist on Youtube

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data: nil) ⇒ YouTubePlaylist

Returns a new instance of YouTubePlaylist.



8
9
10
# File 'lib/share_learning/youtube_playlist.rb', line 8

def initialize(data: nil)
  @results = load_data(data)
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



6
7
8
# File 'lib/share_learning/youtube_playlist.rb', line 6

def results
  @results
end

Class Method Details

.find(keyword:) ⇒ Object



12
13
14
15
# File 'lib/share_learning/youtube_playlist.rb', line 12

def self.find(keyword:)
  playlists = YouTube::YouTubeAPI.get_playlist(keyword)
  new(data: playlists)
end