Class: Yt::Models::Asset

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

Overview

Provides methods to interact with YouTube ContentID assets.

Constant Summary collapse

STATUSES =

Status

%q(active inactive pending)

Instance Attribute Summary collapse

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 = {}) ⇒ Asset

Returns a new instance of Asset.



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

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

Instance Attribute Details

#authObject (readonly)

Returns the value of attribute auth.



8
9
10
# File 'lib/yt/models/asset.rb', line 8

def auth
  @auth
end

#ownershipYt::Models::Ownership (readonly)

Returns the asset’s ownership.

Returns:



24
# File 'lib/yt/models/asset.rb', line 24

has_one :ownership

Instance Method Details

#idString

Returns the ID that YouTube assigns and uses to uniquely identify the asset.

Returns:

  • (String)

    the ID that YouTube assigns and uses to uniquely identify the asset.



45
# File 'lib/yt/models/asset.rb', line 45

has_attribute :id

#typeString

Returns the asset’s type. This value determines the metadata fields that you can set for the asset. In addition, certain API functions may only be supported for specific types of assets. For example, composition assets may have more complex ownership data than other types of assets. Valid values for this property are: art_track_video, composition, episode, general, movie, music_video, season, show, sound_recording, video_game, and web.

Returns:

  • (String)

    the asset’s type. This value determines the metadata fields that you can set for the asset. In addition, certain API functions may only be supported for specific types of assets. For example, composition assets may have more complex ownership data than other types of assets. Valid values for this property are: art_track_video, composition, episode, general, movie, music_video, season, show, sound_recording, video_game, and web.



55
# File 'lib/yt/models/asset.rb', line 55

has_attribute :type

#update(attributes = {}) ⇒ Object



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

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