Class: Yt::Collections::PlaylistItems

Inherits:
Resources
  • Object
show all
Defined in:
lib/yt/collections/playlist_items.rb

Instance Method Summary collapse

Methods inherited from Base

#includes, #initialize, of, #where

Constructor Details

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

Instance Method Details

#insert(attributes = {}, options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/yt/collections/playlist_items.rb', line 7

def insert(attributes = {}, options = {})
  super attributes.merge(playlist_id: @parent.id), options
rescue Yt::Error => error
  ignorable_errors = error.reasons & ['videoNotFound', 'forbidden']
  raise error unless options[:ignore_errors] && ignorable_errors.any?
end