Class: Yt::Models::Rating

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/models/rating.rb

Overview

Provides methods to modify the rating of a video on YouTube.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Rating



13
14
15
16
17
# File 'lib/yt/models/rating.rb', line 13

def initialize(options = {})
  @rating = options[:rating].to_sym if options[:rating]
  @video_id = options[:video_id]
  @auth = options[:auth]
end

Instance Attribute Details

#ratingSymbol or nil (readonly)



11
12
13
# File 'lib/yt/models/rating.rb', line 11

def rating
  @rating
end

Instance Method Details

#update(new_rating) ⇒ Object



19
20
21
# File 'lib/yt/models/rating.rb', line 19

def update(new_rating)
  do_update(params: {rating: new_rating}) {@rating = new_rating}
end