Class: Yt::Models::Asset
- Inherits:
-
Base
- Object
- Base
- Yt::Models::Asset
- Defined in:
- lib/yt/models/asset.rb
Overview
Provides methods to interact with YouTube ContentID assets.
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
-
#ownership ⇒ Yt::Models::Ownership
readonly
The asset’s ownership.
Instance Method Summary collapse
-
#id ⇒ String
The ID that YouTube assigns and uses to uniquely identify the asset.
-
#initialize(options = {}) ⇒ Asset
constructor
A new instance of Asset.
-
#label ⇒ Array<String>
The list of asset labels associated with the asset.
- #metadata_effective ⇒ Object
- #metadata_mine ⇒ Object
- #ownership_effective ⇒ Object
-
#type ⇒ String
Returns the asset’s type.
- #update(attributes = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Asset
Returns a new instance of Asset.
11 12 13 14 15 16 |
# File 'lib/yt/models/asset.rb', line 11 def initialize( = {}) @data = .fetch(:data, {}) @id = [:id] @auth = [:auth] @params = [:params] end |
Instance Attribute Details
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
9 10 11 |
# File 'lib/yt/models/asset.rb', line 9 def auth @auth end |
#ownership ⇒ Yt::Models::Ownership (readonly)
Returns the asset’s ownership.
26 |
# File 'lib/yt/models/asset.rb', line 26 has_one :ownership |
Instance Method Details
#id ⇒ String
Returns the ID that YouTube assigns and uses to uniquely identify the asset.
59 |
# File 'lib/yt/models/asset.rb', line 59 has_attribute :id |
#label ⇒ Array<String>
Returns the list of asset labels associated with the asset. You can apply a label to multiple assets to group them. You can use the labels as search filters to perform bulk updates, to download reports, or to filter YouTube Analytics.
76 |
# File 'lib/yt/models/asset.rb', line 76 has_attribute :label, default: [] |
#metadata_effective ⇒ Object
34 35 36 |
# File 'lib/yt/models/asset.rb', line 34 def @metadata_effective ||= Yt::Models::AssetMetadata.new data: @data.fetch('metadataEffective', {}) end |
#metadata_mine ⇒ Object
30 31 32 |
# File 'lib/yt/models/asset.rb', line 30 def @metadata_mine ||= Yt::Models::AssetMetadata.new data: @data.fetch('metadataMine', {}) end |
#ownership_effective ⇒ Object
38 39 40 |
# File 'lib/yt/models/asset.rb', line 38 def ownership_effective @ownership_effective ||= Yt::Models::Ownership.new data: @data.fetch('ownershipEffective', {}) end |
#type ⇒ String
Returns the asset’s type.
70 |
# File 'lib/yt/models/asset.rb', line 70 has_attribute :type |
#update(attributes = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/yt/models/asset.rb', line 18 def update(attributes = {}) underscore_keys! attributes do_update body: attributes true end |