Class: Yt::Models::Reference
- Inherits:
-
Base
- Object
- Base
- Yt::Models::Reference
- Defined in:
- lib/yt/models/reference.rb
Overview
Provides methods to interact with YouTube ContentID references.
Instance Method Summary collapse
-
#activating? ⇒ Boolean
Whether the reference is pending.
-
#active? ⇒ Boolean
Whether the reference is active.
-
#asset_id ⇒ String
The ID that uniquely identifies the asset that the reference is associated with.
-
#audio? ⇒ Boolean
Whether the reference covers only the audio.
-
#audioswap_enabled? ⇒ boolean
Whether or not the reference content is included in YouTube’s AudioSwap program.
-
#audiovisual? ⇒ Boolean
Whether the reference covers both audio and video.
-
#checking? ⇒ Boolean
Whether the reference is being compared to existing references to identify any reference conflicts that might exist.
-
#claim_id ⇒ String
The claim ID that represents the resulting association between the asset and the video.
-
#computing_fingerprint? ⇒ Boolean
Whether the reference’s fingerprint is being computed.
-
#content_type ⇒ String
Returns the audiovisual portion of the referenced content.
-
#delete ⇒ Boolean
Soft-deletes the reference.
-
#deleted? ⇒ Boolean
Whether the reference is deleted.
-
#duplicate_leader ⇒ String
The ID that uniquely identifies the reference that this reference duplicates.
-
#duplicate_on_hold? ⇒ Boolean
Whether the reference iis a duplicate and is on hold.
-
#id ⇒ String
The ID that YouTube assigns and uses to uniquely identify the reference.
-
#ignore_fp_match? ⇒ boolean
Should the reference be used to generate claims.
-
#inactive? ⇒ Boolean
Whether the reference is inactive.
-
#initialize(options = {}) ⇒ Reference
constructor
A new instance of Reference.
-
#length ⇒ Float
The length of the reference in seconds.
-
#live_streaming_processing? ⇒ Boolean
Whether the reference is being processed from a live video stream.
-
#status ⇒ String
The reference’s status.
-
#status_reason ⇒ String
An explanation of how a reference entered its current state.
-
#urgent? ⇒ Boolean
The urgent status of the reference file.
-
#urgent_reference_processing? ⇒ Boolean
Whether the reference is urgent_reference_processing.
-
#video? ⇒ Boolean
Whether the reference covers only the video.
-
#video_id ⇒ String
The ID of the source video.
Constructor Details
#initialize(options = {}) ⇒ Reference
8 9 10 11 12 |
# File 'lib/yt/models/reference.rb', line 8 def initialize( = {}) @data = [:data] @id = [:id] @auth = [:auth] end |
Instance Method Details
#activating? ⇒ Boolean
91 92 93 |
# File 'lib/yt/models/reference.rb', line 91 def activating? status == 'activating' end |
#active? ⇒ Boolean
96 97 98 |
# File 'lib/yt/models/reference.rb', line 96 def active? status == 'active' end |
#asset_id ⇒ String
33 |
# File 'lib/yt/models/reference.rb', line 33 has_attribute :asset_id |
#audio? ⇒ Boolean
146 147 148 |
# File 'lib/yt/models/reference.rb', line 146 def audio? content_type == 'audio' end |
#audioswap_enabled? ⇒ boolean
55 |
# File 'lib/yt/models/reference.rb', line 55 has_attribute :audioswap_enabled?, from: :audioswap_enabled |
#audiovisual? ⇒ Boolean
156 157 158 |
# File 'lib/yt/models/reference.rb', line 156 def audiovisual? content_type == 'audiovisual' end |
#checking? ⇒ Boolean
102 103 104 |
# File 'lib/yt/models/reference.rb', line 102 def checking? status == 'checking' end |
#claim_id ⇒ String
49 |
# File 'lib/yt/models/reference.rb', line 49 has_attribute :claim_id |
#computing_fingerprint? ⇒ Boolean
108 109 110 |
# File 'lib/yt/models/reference.rb', line 108 def computing_fingerprint? status == 'computing_fingerprint' end |
#content_type ⇒ String
Returns the audiovisual portion of the referenced content.
143 |
# File 'lib/yt/models/reference.rb', line 143 has_attribute :content_type |
#delete ⇒ Boolean
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.
Soft-deletes the reference.
21 22 23 24 25 |
# File 'lib/yt/models/reference.rb', line 21 def delete body = {id: id, status: :inactive} do_update(body: body) {|data| @data = data} inactive? end |
#deleted? ⇒ Boolean
113 114 115 |
# File 'lib/yt/models/reference.rb', line 113 def deleted? status == 'deleted' end |
#duplicate_leader ⇒ String
80 |
# File 'lib/yt/models/reference.rb', line 80 has_attribute :duplicate_leader |
#duplicate_on_hold? ⇒ Boolean
118 119 120 |
# File 'lib/yt/models/reference.rb', line 118 def duplicate_on_hold? status == 'duplicate_on_hold' end |
#id ⇒ String
29 |
# File 'lib/yt/models/reference.rb', line 29 has_attribute :id |
#ignore_fp_match? ⇒ boolean
60 |
# File 'lib/yt/models/reference.rb', line 60 has_attribute :ignore_fp_match?, from: :ignore_fp_match |
#inactive? ⇒ Boolean
123 124 125 |
# File 'lib/yt/models/reference.rb', line 123 def inactive? status == 'inactive' end |
#length ⇒ Float
36 |
# File 'lib/yt/models/reference.rb', line 36 has_attribute :length |
#live_streaming_processing? ⇒ Boolean
129 130 131 |
# File 'lib/yt/models/reference.rb', line 129 def live_streaming_processing? status == 'live_streaming_processing' end |
#status ⇒ String
88 |
# File 'lib/yt/models/reference.rb', line 88 has_attribute :status |
#status_reason ⇒ String
75 |
# File 'lib/yt/models/reference.rb', line 75 has_attribute :status_reason |
#urgent? ⇒ Boolean
70 |
# File 'lib/yt/models/reference.rb', line 70 has_attribute :urgent?, from: :urgent |
#urgent_reference_processing? ⇒ Boolean
134 135 136 |
# File 'lib/yt/models/reference.rb', line 134 def urgent_reference_processing? status == 'urgent_reference_processing' end |
#video? ⇒ Boolean
151 152 153 |
# File 'lib/yt/models/reference.rb', line 151 def video? content_type == 'video' end |
#video_id ⇒ String
42 |
# File 'lib/yt/models/reference.rb', line 42 has_attribute :video_id |