class Yt::Collections::Ownerships

Provides methods to interact with a the ownership of a YouTube resource.

Resources with ownerships are: {Yt::Models::Asset assets}.

Private Instance Methods

attributes_for_new_item(data) click to toggle source
# File lib/yt/collections/ownerships.rb, line 13
def attributes_for_new_item(data)
  {data: data, asset_id: @parent.id, auth: @auth}
end
fetch_page(params = {}) click to toggle source

@private @note Ownerships overwrites fetch_page since it’s a get.

# File lib/yt/collections/ownerships.rb, line 28
def fetch_page(params = {})
  response = list_request(params).run
  {items: [response.body], token: nil}
end
list_params() click to toggle source

@return [Hash] the parameters to submit to YouTube to get ownerships. @see developers.google.com/youtube/partner/docs/v1/ownership/get

Calls superclass method
# File lib/yt/collections/ownerships.rb, line 19
def list_params
  super.tap do |params|
    params[:path] = "/youtube/partner/v1/assets/#{@parent.id}/ownership"
    params[:params] = {on_behalf_of_content_owner: @auth.owner_name}
  end
end