Class: Yt::Models::Video
- Defined in:
- lib/yt/models/video.rb
Overview
Provides methods to interact with YouTube videos.
Instance Attribute Summary collapse
-
#annotations ⇒ Yt::Collections::Annotations
readonly
The video’s annotations.
-
#content_detail ⇒ Yt::Models::ContentDetail
readonly
The video’s content details.
-
#rating ⇒ Yt::Models::Rating
readonly
The video’s rating.
-
#statistics_set ⇒ Yt::Models::StatisticsSet
readonly
The statistics for the video.
Attributes inherited from Resource
Instance Method Summary collapse
-
#dislike ⇒ Boolean
Dislikes the video on behalf of the authenticated account.
-
#like ⇒ Boolean
Likes the video on behalf of the authenticated account.
-
#liked? ⇒ Boolean
Returns whether the authenticated account likes the video.
-
#unlike ⇒ Boolean
Resets the rating of the video on behalf of the authenticated account.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Yt::Models::Resource
Instance Attribute Details
#annotations ⇒ Yt::Collections::Annotations (readonly)
Returns the video’s annotations.
20 |
# File 'lib/yt/models/video.rb', line 20 has_many :annotations |
#content_detail ⇒ Yt::Models::ContentDetail (readonly)
Returns the video’s content details.
10 |
# File 'lib/yt/models/video.rb', line 10 has_one :content_detail |
#rating ⇒ Yt::Models::Rating (readonly)
Returns the video’s rating.
16 |
# File 'lib/yt/models/video.rb', line 16 has_one :rating |
#statistics_set ⇒ Yt::Models::StatisticsSet (readonly)
Returns the statistics for the video.
24 |
# File 'lib/yt/models/video.rb', line 24 has_one :statistics_set |
Instance Method Details
#dislike ⇒ Boolean
58 59 60 61 |
# File 'lib/yt/models/video.rb', line 58 def dislike .update :dislike !liked? end |
#like ⇒ Boolean
46 47 48 49 |
# File 'lib/yt/models/video.rb', line 46 def like .update :like liked? end |
#liked? ⇒ Boolean
35 36 37 |
# File 'lib/yt/models/video.rb', line 35 def liked? . == :like end |