class Yt::Models::Reference
Provides methods to interact with YouTube ContentID references. @see developers.google.com/youtube/partner/docs/v1/references
Public Class Methods
Source
# File lib/yt/models/reference.rb, line 8 def initialize(options = {}) @data = options[:data] @id = options[:id] @auth = options[:auth] end
Public Instance Methods
Source
# File lib/yt/models/reference.rb, line 91 def activating? status == 'activating' end
@return [Boolean] whether the reference is pending.
Source
# File lib/yt/models/reference.rb, line 96 def active? status == 'active' end
@return [Boolean] whether the reference is active.
Source
# File lib/yt/models/reference.rb, line 146 def audio? content_type == 'audio' end
@return [Boolean] whether the reference covers only the audio.
Source
# File lib/yt/models/reference.rb, line 156 def audiovisual? content_type == 'audiovisual' end
@return [Boolean] whether the reference covers both audio and video.
Source
# File lib/yt/models/reference.rb, line 102 def checking? status == 'checking' end
@return [Boolean] whether the reference is being compared to existing
references to identify any reference conflicts that might exist.
Source
# File lib/yt/models/reference.rb, line 108 def computing_fingerprint? status == 'computing_fingerprint' end
@return [Boolean] whether the reference’s fingerprint is being
computed.
Source
# File lib/yt/models/reference.rb, line 21 def delete body = {id: id, status: :inactive} do_update(body: body) {|data| @data = data} inactive? end
Soft-deletes the reference.
@note YouTube API does not provide a delete
method for the Reference
resource, but only an +update+ method. Updating the +status+ of a Reference to "inactive" can be considered a soft-deletion, since it allows to successively create new references for the same claim.
@return [Boolean] whether the reference is inactive.
Source
# File lib/yt/models/reference.rb, line 113 def deleted? status == 'deleted' end
@return [Boolean] whether the reference is deleted.
Source
# File lib/yt/models/reference.rb, line 118 def duplicate_on_hold? status == 'duplicate_on_hold' end
@return [Boolean] whether the reference iis a duplicate and is on hold.
Source
# File lib/yt/models/reference.rb, line 123 def inactive? status == 'inactive' end
@return [Boolean] whether the reference is inactive.
Source
# File lib/yt/models/reference.rb, line 129 def live_streaming_processing? status == 'live_streaming_processing' end
@return [Boolean] whether the reference is being processed from a live
video stream.
Source
# File lib/yt/models/reference.rb, line 134 def urgent_reference_processing? status == 'urgent_reference_processing' end
@return [Boolean] whether the reference is urgent_reference_processing.
Source
# File lib/yt/models/reference.rb, line 151 def video? content_type == 'video' end
@return [Boolean] whether the reference covers only the video.
Private Instance Methods
Source
# File lib/yt/models/reference.rb, line 163 def update_params super.tap do |params| params[:expected_response] = Net::HTTPOK params[:path] = "/youtube/partner/v1/references/#{id}" params[:params] = {on_behalf_of_content_owner: @auth.owner_name} end end
@see developers.google.com/youtube/partner/docs/v1/references/update
Yt::Actions::Update#update_params