class Yt::Models::Ownership
Provides methods to interact with YouTube ContentID asset ownership, which provide ownership information for the specified asset. @see developers.google.com/youtube/partner/docs/v1/ownership
Public Class Methods
Source
# File lib/yt/models/ownership.rb, line 10 def initialize(options = {}) @data = options[:data] || {} @auth = options[:auth] @asset_id = options[:asset_id] end
Public Instance Methods
Source
# File lib/yt/models/ownership.rb, line 23 def obtain! update general: [{ratio: 100, owner: @auth.owner_name, type: :exclude}] end
Assigns 100% of the general ownership of the asset to @auth.
Source
# File lib/yt/models/ownership.rb, line 28 def release! update general: [{ratio: 0, owner: @auth.owner_name, type: :exclude}] end
Releases 100% of the general ownership of the asset from @auth.
Source
# File lib/yt/models/ownership.rb, line 16 def update(attributes = {}) underscore_keys! attributes do_update body: attributes true end
Private Instance Methods
Source
# File lib/yt/models/ownership.rb, line 70 def as_owners(data) (data || []).map{|owner_data| Yt::RightOwner.new data: owner_data} end
Source
# File lib/yt/models/ownership.rb, line 62 def update_params super.tap do |params| params[:expected_response] = Net::HTTPOK params[:path] = "/youtube/partner/v1/assets/#{@asset_id}/ownership" params[:params] = {on_behalf_of_content_owner: @auth.owner_name} end end
@see developers.google.com/youtube/partner/docs/v1/ownership/update
Calls superclass method
Yt::Actions::Update#update_params