Class: Yt::Collections::Playlists

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/collections/playlists.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, of, #where

Methods included from Actions::List

#first!

Constructor Details

This class inherits a constructor from Yt::Collections::Base

Instance Method Details

#delete_all(params = {}) ⇒ Object



22
23
24
# File 'lib/yt/collections/playlists.rb', line 22

def delete_all(params = {})
  do_delete_all params
end

#insert(options = {}) ⇒ Object

Valid body (no defaults) are: title (string), description (string), privacy_status (string), tags (array of strings)



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

def insert(options = {})
  body = {}

  snippet = options.slice :title, :description, :tags
  body[:snippet] = snippet if snippet.any?

  status = options[:privacy_status]
  body[:status] = {privacyStatus: status} if status

  do_insert body: body, params: {part: 'snippet,status'}
end