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.
-
#details_set ⇒ Yt::Models::DetailsSet
readonly
The video’s content details.
-
#rating ⇒ Yt::Models::Rating
readonly
The video’s rating.
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.
19 |
# File 'lib/yt/models/video.rb', line 19 has_many :annotations |
#details_set ⇒ Yt::Models::DetailsSet (readonly)
Returns the video’s content details.
10 |
# File 'lib/yt/models/video.rb', line 10 has_one :details_set |
#rating ⇒ Yt::Models::Rating (readonly)
Returns the video’s rating.
15 |
# File 'lib/yt/models/video.rb', line 15 has_one :rating |
Instance Method Details
#dislike ⇒ Boolean
51 52 53 54 |
# File 'lib/yt/models/video.rb', line 51 def dislike .update :dislike !liked? end |
#like ⇒ Boolean
39 40 41 42 |
# File 'lib/yt/models/video.rb', line 39 def like .update :like liked? end |
#liked? ⇒ Boolean
28 29 30 |
# File 'lib/yt/models/video.rb', line 28 def liked? . == :like end |