Class: Yt::Models::AdvertisingOptionsSet

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

Overview

Encapsulates advertising options of a video, such as the types of ads that can run during the video as well as the times when ads are allowed to run during the video.

Instance Method Summary collapse

Methods included from Associations::HasReports

#has_report

Methods included from Associations::HasViewerPercentages

#has_viewer_percentages

Methods included from Associations::HasOne

#has_one

Methods included from Associations::HasMany

#has_many

Methods included from Associations::HasAuthentication

#has_authentication

Constructor Details

#initialize(options = {}) ⇒ AdvertisingOptionsSet

Returns a new instance of AdvertisingOptionsSet.



10
11
12
13
14
# File 'lib/yt/models/advertising_options_set.rb', line 10

def initialize(options = {})
  @auth = options[:auth]
  @video_id = options[:video_id]
  @data = options[:data]
end

Instance Method Details

#ad_formatsArray<String>

Return the list of ad formats that the video is allowed to show. Valid values for this property are: long, overlay, standard_instream, third_party, trueview_inslate, or trueview_instream.

Returns:

  • (Array<String>)

    the list of ad formats that the video is allowed to show.



27
28
29
# File 'lib/yt/models/advertising_options_set.rb', line 27

def ad_formats
  @data['adFormats']
end

#update(attributes = {}) ⇒ Object



16
17
18
19
20
# File 'lib/yt/models/advertising_options_set.rb', line 16

def update(attributes = {})
  underscore_keys! attributes
  do_patch(body: attributes) {|data| @data = data}
  true
end