Class: Yt::Models::RightOwner

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

Overview

Encapsulates information about the various types of owners of an asset.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RightOwner

Returns a new instance of RightOwner.



6
7
8
# File 'lib/yt/models/right_owner.rb', line 6

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

Instance Method Details

#everywhere?Boolean

Returns whether the ownership applies to the whole world.

Returns:

  • (Boolean)

    whether the ownership applies to the whole world.



46
47
48
# File 'lib/yt/models/right_owner.rb', line 46

def everywhere?
  excluded_territories == []
end

#excluded_territoriesArray<String>?

Return the list of territories where the owner does not own the asset. Each territory is an ISO 3166 two-letter country code.

Returns:

  • (Array<String>)

    if the ownership lists ‘excluded’ territories, the territories where the owner does not own the asset.

  • (nil)

    if the ownership does not list ‘excluded’ territories,



41
42
43
# File 'lib/yt/models/right_owner.rb', line 41

def excluded_territories
  territories if type == 'exclude'
end

#included_territoriesArray<String>?

Return the list of territories where the owner owns the asset. Each territory is an ISO 3166 two-letter country code.

Returns:

  • (Array<String>)

    if the ownership lists ‘included’ territories, the territories where the owner owns the asset.

  • (nil)

    if the ownership does not list ‘included’ territories,



32
33
34
# File 'lib/yt/models/right_owner.rb', line 32

def included_territories
  territories if type == 'include'
end

#ownerString

Returns the name of the asset’s owner or rights administrator.

Returns:

  • (String)

    the name of the asset’s owner or rights administrator.



19
# File 'lib/yt/models/right_owner.rb', line 19

has_attribute :owner

#publisherString?

Returns:

  • (String)

    if the asset is a composition asset and the asset owner is not known to have a formal relationship established with YouTube, the name of the asset’s publisher or rights administrator.

  • (nil)

    otherwise.



25
# File 'lib/yt/models/right_owner.rb', line 25

has_attribute :publisher

#ratioFloat

Returns the percentage of the asset that the owner controls or administers. For composition assets, the value can be any value between 0 and 100 inclusive. For all other assets, the only valid values are 100, which indicates that the owner completely owns the asset in the specified territories, and 0, which indicates that you are removing ownership of the asset in the specified territories.

Returns:

  • (Float)

    the percentage of the asset that the owner controls or administers. For composition assets, the value can be any value between 0 and 100 inclusive. For all other assets, the only valid values are 100, which indicates that the owner completely owns the asset in the specified territories, and 0, which indicates that you are removing ownership of the asset in the specified territories.



16
# File 'lib/yt/models/right_owner.rb', line 16

has_attribute :ratio, type: Float