Class: Yt::Collections::Subscriptions

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/collections/subscriptions.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

#insert(options = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/yt/collections/subscriptions.rb', line 8

def insert(options = {})
  do_insert
rescue Yt::Error => error
  ignorable_error = error.reasons.include? 'subscriptionDuplicate'
  ignorable_error ||= (@parent.id == @auth.channel.id) if @auth
  raise error unless options[:ignore_errors] && ignorable_error
end