Class: Yt::Models::Status
Overview
Contains information about the status of a resource. The details of the status are different for the different types of resources.
Resources with a status are: channels, playlists, playlist items and videos.
Constant Summary collapse
- PRIVACY_STATUSES =
Privacy status
%q(private public unlisted)
Instance Method Summary collapse
-
#aborted? ⇒ Boolean?
Returns whether a video upload failed because the upload was aborted.
-
#belongs_to_closed_account? ⇒ Boolean?
Returns whether a video was rejected because the account was closed.
-
#belongs_to_suspended_account? ⇒ Boolean?
Returns whether a video was rejected because the account was suspended.
-
#claimed? ⇒ Boolean?
Returns whether a video was rejected because it was claimed.
-
#deleted? ⇒ Boolean?
Returns whether an uploaded video was deleted.
-
#duplicate? ⇒ Boolean?
Returns whether a video was rejected because it is a duplicate.
-
#embeddable ⇒ Object
deprecated
Deprecated.
Use #embeddable? instead.
-
#embeddable? ⇒ Boolean?
Returns whether the video can be embedded on another website.
-
#empty? ⇒ Boolean?
Returns whether a video upload failed because the file was empty.
-
#failed? ⇒ Boolean?
Returns whether a video failed to upload.
-
#failure_reason ⇒ String?
Returns the reason why a video failed to upload.
-
#has_failed_conversion? ⇒ Boolean?
Returns whether YouTube was unable to convert an uploaded video.
-
#has_public_stats_viewable? ⇒ Boolean?
Returns whether the video statistics are publicly viewable.
-
#inappropriate? ⇒ Boolean?
Returns whether a video was rejected because of inappropriate content.
-
#infringes_copyright? ⇒ Boolean?
Returns whether a video was rejected because of copyright infringement.
-
#infringes_trademark? ⇒ Boolean?
Returns whether a video was rejected because of trademark infringement.
-
#initialize(options = {}) ⇒ Status
constructor
A new instance of Status.
-
#invalid? ⇒ Boolean?
Returns whether a video upload failed because of the file format.
-
#license ⇒ String?
Returns the video’s license.
-
#licensed_as_creative_commons? ⇒ Boolean?
Returns whether the video uses a Creative Commons license.
-
#licensed_as_standard_youtube? ⇒ Boolean?
Returns whether the video uses the Standard YouTube license.
-
#privacy_status ⇒ String
The privacy status of the resource.
-
#private? ⇒ Boolean
Whether the resource is private.
-
#processed? ⇒ Boolean?
Returns whether an uploaded video is being processed by YouTube.
-
#public? ⇒ Boolean
Whether the resource is public.
-
#public_stats_viewable ⇒ Object
deprecated
Deprecated.
Use #has_public_stats_viewable? instead.
-
#rejected? ⇒ Boolean?
Returns whether the video was rejected by YouTube.
-
#rejection_reason ⇒ String?
Returns the reason why a video was rejected by YouTube.
-
#scheduled? ⇒ Boolean?
Returns whether the video is scheduled to be published.
-
#scheduled_at ⇒ Time?
Returns the date and time when a video is scheduled to be published.
-
#too_long? ⇒ Boolean?
Returns whether a video was rejected because it is too long.
-
#too_small? ⇒ Boolean?
Returns whether a video upload failed because the file was too small.
-
#unlisted? ⇒ Boolean
Whether the resource is unlisted.
-
#upload_status ⇒ String?
Returns the upload status of a video.
-
#uploaded? ⇒ Boolean?
Returns whether a video was successfully uploaded to YouTube.
-
#uses_unsupported_codec? ⇒ Boolean?
Returns whether a video upload failed because of the codec.
-
#violates_terms_of_use? ⇒ Boolean?
Returns whether a video was rejected because it violates terms of use.
Methods included from Associations::HasReports
Methods included from Associations::HasViewerPercentages
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
Constructor Details
#initialize(options = {}) ⇒ Status
Returns a new instance of Status.
15 16 17 |
# File 'lib/yt/models/status.rb', line 15 def initialize( = {}) @data = [:data] end |
Instance Method Details
#aborted? ⇒ Boolean?
Returns whether a video upload failed because the upload was aborted.
148 149 150 |
# File 'lib/yt/models/status.rb', line 148 def aborted? failure_reason == 'uploadAborted' if video? end |
#belongs_to_closed_account? ⇒ Boolean?
Returns whether a video was rejected because the account was closed.
224 225 226 |
# File 'lib/yt/models/status.rb', line 224 def belongs_to_closed_account? rejection_reason == 'uploaderAccountClosed' if video? end |
#belongs_to_suspended_account? ⇒ Boolean?
Returns whether a video was rejected because the account was suspended.
232 233 234 |
# File 'lib/yt/models/status.rb', line 232 def belongs_to_suspended_account? rejection_reason == 'uploaderAccountSuspended' if video? end |
#claimed? ⇒ Boolean?
Returns whether a video was rejected because it was claimed.
166 167 168 |
# File 'lib/yt/models/status.rb', line 166 def claimed? rejection_reason == 'claim' if video? end |
#deleted? ⇒ Boolean?
Returns whether an uploaded video was deleted.
55 56 57 |
# File 'lib/yt/models/status.rb', line 55 def deleted? upload_status == 'deleted' if video? end |
#duplicate? ⇒ Boolean?
Returns whether a video was rejected because it is a duplicate.
182 183 184 |
# File 'lib/yt/models/status.rb', line 182 def duplicate? rejection_reason == 'duplicate' if video? end |
#embeddable ⇒ Object
Use #embeddable? instead.
290 291 292 |
# File 'lib/yt/models/status.rb', line 290 def end |
#embeddable? ⇒ Boolean?
Returns whether the video can be embedded on another website.
287 |
# File 'lib/yt/models/status.rb', line 287 has_attribute :embeddable?, from: :embeddable |
#empty? ⇒ Boolean?
Returns whether a video upload failed because the file was empty.
123 124 125 |
# File 'lib/yt/models/status.rb', line 123 def empty? failure_reason == 'emptyFile' if video? end |
#failed? ⇒ Boolean?
Returns whether a video failed to upload. If true, the reason why the video upload failed can be obtained with failure_reason
.
64 65 66 |
# File 'lib/yt/models/status.rb', line 64 def failed? upload_status == 'failed' if video? end |
#failure_reason ⇒ String?
Returns the reason why a video failed to upload.
100 |
# File 'lib/yt/models/status.rb', line 100 has_attribute :failure_reason |
#has_failed_conversion? ⇒ Boolean?
Returns whether YouTube was unable to convert an uploaded video.
115 116 117 |
# File 'lib/yt/models/status.rb', line 115 def has_failed_conversion? failure_reason == 'conversion' if video? end |
#has_public_stats_viewable? ⇒ Boolean?
Returns whether the video statistics are publicly viewable.
303 |
# File 'lib/yt/models/status.rb', line 303 has_attribute :has_public_stats_viewable?, from: :public_stats_viewable |
#inappropriate? ⇒ Boolean?
Returns whether a video was rejected because of inappropriate content.
190 191 192 |
# File 'lib/yt/models/status.rb', line 190 def inappropriate? rejection_reason == 'inappropriate' if video? end |
#infringes_copyright? ⇒ Boolean?
Returns whether a video was rejected because of copyright infringement.
174 175 176 |
# File 'lib/yt/models/status.rb', line 174 def infringes_copyright? rejection_reason == 'copyright' if video? end |
#infringes_trademark? ⇒ Boolean?
Returns whether a video was rejected because of trademark infringement.
216 217 218 |
# File 'lib/yt/models/status.rb', line 216 def infringes_trademark? rejection_reason == 'trademark' if video? end |
#invalid? ⇒ Boolean?
Returns whether a video upload failed because of the file format.
132 133 134 |
# File 'lib/yt/models/status.rb', line 132 def invalid? failure_reason == 'invalidFile' if video? end |
#license ⇒ String?
Returns the video’s license.
261 |
# File 'lib/yt/models/status.rb', line 261 has_attribute :license |
#licensed_as_creative_commons? ⇒ Boolean?
Returns whether the video uses a Creative Commons license.
268 269 270 |
# File 'lib/yt/models/status.rb', line 268 def licensed_as_creative_commons? license == 'creativeCommon' if video? end |
#licensed_as_standard_youtube? ⇒ Boolean?
Returns whether the video uses the Standard YouTube license.
277 278 279 |
# File 'lib/yt/models/status.rb', line 277 def licensed_as_standard_youtube? license == 'youtube' if video? end |
#privacy_status ⇒ String
Returns the privacy status of the resource. Valid values are: private, public, unlisted.
25 |
# File 'lib/yt/models/status.rb', line 25 has_attribute :privacy_status |
#private? ⇒ Boolean
Returns whether the resource is private.
33 34 35 |
# File 'lib/yt/models/status.rb', line 33 def private? privacy_status == 'private' end |
#processed? ⇒ Boolean?
Returns whether an uploaded video is being processed by YouTube.
72 73 74 |
# File 'lib/yt/models/status.rb', line 72 def processed? upload_status == 'processed' if video? end |
#public? ⇒ Boolean
Returns whether the resource is public.
28 29 30 |
# File 'lib/yt/models/status.rb', line 28 def public? privacy_status == 'public' end |
#public_stats_viewable ⇒ Object
Use #has_public_stats_viewable? instead.
306 307 308 |
# File 'lib/yt/models/status.rb', line 306 def public_stats_viewable has_public_stats_viewable? end |
#rejected? ⇒ Boolean?
Returns whether the video was rejected by YouTube. If true, the reason why the video was rejected can be obtained with rejection_reason
.
81 82 83 |
# File 'lib/yt/models/status.rb', line 81 def rejected? upload_status == 'rejected' if video? end |
#rejection_reason ⇒ String?
Returns the reason why a video was rejected by YouTube.
160 |
# File 'lib/yt/models/status.rb', line 160 has_attribute :rejection_reason |
#scheduled? ⇒ Boolean?
Returns whether the video is scheduled to be published.
251 252 253 |
# File 'lib/yt/models/status.rb', line 251 def scheduled? private? && publish_at if video? end |
#scheduled_at ⇒ Time?
Returns the date and time when a video is scheduled to be published.
243 244 245 |
# File 'lib/yt/models/status.rb', line 243 def scheduled_at publish_at if scheduled? end |
#too_long? ⇒ Boolean?
Returns whether a video was rejected because it is too long.
199 200 201 |
# File 'lib/yt/models/status.rb', line 199 def too_long? rejection_reason == 'length' if video? end |
#too_small? ⇒ Boolean?
Returns whether a video upload failed because the file was too small.
140 141 142 |
# File 'lib/yt/models/status.rb', line 140 def too_small? failure_reason == 'tooSmall' if video? end |
#unlisted? ⇒ Boolean
Returns whether the resource is unlisted.
38 39 40 |
# File 'lib/yt/models/status.rb', line 38 def unlisted? privacy_status == 'unlisted' end |
#upload_status ⇒ String?
Returns the upload status of a video.
49 |
# File 'lib/yt/models/status.rb', line 49 has_attribute :upload_status |
#uploaded? ⇒ Boolean?
Returns whether a video was successfully uploaded to YouTube.
89 90 91 |
# File 'lib/yt/models/status.rb', line 89 def uploaded? upload_status == 'uploaded' if video? end |
#uses_unsupported_codec? ⇒ Boolean?
Returns whether a video upload failed because of the codec.
107 108 109 |
# File 'lib/yt/models/status.rb', line 107 def uses_unsupported_codec? failure_reason == 'codec' if video? end |
#violates_terms_of_use? ⇒ Boolean?
Returns whether a video was rejected because it violates terms of use.
207 208 209 |
# File 'lib/yt/models/status.rb', line 207 def violates_terms_of_use? rejection_reason == 'termsOfUse' if video? end |