class Yt::Models::Asset
Provides methods to interact with YouTube ContentID assets. @see developers.google.com/youtube/partner/docs/v1/assets
Attributes
Public Class Methods
Source
# File lib/yt/models/asset.rb, line 11 def initialize(options = {}) @data = options.fetch(:data, {}) @id = options[:id] @auth = options[:auth] @params = options[:params] end
Public Instance Methods
Source
# File lib/yt/models/asset.rb, line 34 def metadata_effective @metadata_effective ||= Yt::Models::AssetMetadata.new data: @data.fetch('metadataEffective', {}) end
Source
# File lib/yt/models/asset.rb, line 30 def metadata_mine @metadata_mine ||= Yt::Models::AssetMetadata.new data: @data.fetch('metadataMine', {}) end
Source
# File lib/yt/models/asset.rb, line 38 def ownership_effective @ownership_effective ||= Yt::Models::Ownership.new data: @data.fetch('ownershipEffective', {}) end
Source
# File lib/yt/models/asset.rb, line 18 def update(attributes = {}) underscore_keys! attributes do_update body: attributes true end
Private Instance Methods
Source
# File lib/yt/models/asset.rb, line 126 def get_params super.tap do |params| params[:path] = "/youtube/partner/v1/assets/#{@id}" params[:params] = {on_behalf_of_content_owner: @auth.owner_name}.merge! @params end end
@return [Hash] the parameters to submit to YouTube to get an asset. @see developers.google.com/youtube/partner/docs/v1/assets/get
Calls superclass method
Source
# File lib/yt/models/asset.rb, line 107 def patch_params super.tap do |params| params[:expected_response] = Net::HTTPOK params[:path] = "/youtube/partner/v1/assets/#{@id}" params[:params] = {on_behalf_of_content_owner: @auth.owner_name} end end
@see developers.google.com/youtube/partner/docs/v1/assets/patch
Calls superclass method
Source
# File lib/yt/models/asset.rb, line 116 def update_params super.tap do |params| params[:expected_response] = Net::HTTPOK params[:path] = "/youtube/partner/v1/assets/#{@id}" params[:params] = {on_behalf_of_content_owner: @auth.owner_name} end end
@see developers.google.com/youtube/partner/docs/v1/assets/update
Calls superclass method