class Yt::Models::Subscription

@private Provides methods to interact with YouTube subscriptions. @see developers.google.com/youtube/v3/docs/subscriptions

Attributes

id[R]

@return [String] the ID that uniquely identify a YouTube subscription.

Public Class Methods

new(options = {}) click to toggle source
# File lib/yt/models/subscription.rb, line 12
def initialize(options = {})
  @id = options[:id]
  @auth = options[:auth]
end

Public Instance Methods

delete(options = {}, &block) click to toggle source
# File lib/yt/models/subscription.rb, line 17
def delete(options = {}, &block)
  do_delete {@id = nil}
  !exists?
end
exists?() click to toggle source
# File lib/yt/models/subscription.rb, line 22
def exists?
  !@id.nil?
end

Private Instance Methods

delete_params() click to toggle source

@return [Hash] the parameters to submit to YouTube to delete a subscription. @see developers.google.com/youtube/v3/docs/subscriptions/delete

Calls superclass method Yt::Actions::Delete#delete_params
# File lib/yt/models/subscription.rb, line 30
def delete_params
  super.tap do |params|
    params[:path] = '/youtube/v3/subscriptions'
    params[:params] = {id: @id}
  end
end