Class: Yt::Models::Rating
Overview
Provides methods to modify the rating of a video on YouTube.
Instance Attribute Summary collapse
-
#rating ⇒ Symbol?
readonly
The rating of a video (if present).
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Rating
constructor
A new instance of Rating.
- #update(new_rating) ⇒ Object
Methods included from Associations::HasReports
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
Constructor Details
#initialize(options = {}) ⇒ Rating
Returns a new instance of Rating.
13 14 15 16 17 |
# File 'lib/yt/models/rating.rb', line 13 def initialize( = {}) @rating = [:rating].to_sym if [:rating] @video_id = [:video_id] @auth = [:auth] end |
Instance Attribute Details
#rating ⇒ Symbol? (readonly)
Returns the rating of a video (if present). Valid values are: :dislike, :like, :none, :unspecified.
11 12 13 |
# File 'lib/yt/models/rating.rb', line 11 def @rating end |
Instance Method Details
#update(new_rating) ⇒ Object
19 20 21 |
# File 'lib/yt/models/rating.rb', line 19 def update() do_update(params: {rating: }) {@rating = } end |