class Yt::Models::RightOwner

Encapsulates information about the various types of owners of an asset. @see developers.google.com/youtube/partner/docs/v1/ownership#resource

Public Class Methods

new(options = {}) click to toggle source
# File lib/yt/models/right_owner.rb, line 6
def initialize(options = {})
  @data = options[:data]
end

Public Instance Methods

everywhere?() click to toggle source

@return [Boolean] whether the ownership applies to the whole world.

# File lib/yt/models/right_owner.rb, line 46
def everywhere?
  excluded_territories == []
end
excluded_territories() click to toggle source

Return the list of territories where the owner does not own the asset. Each territory is an ISO 3166 two-letter country code. @return [Array<String>] if the ownership lists 'excluded' territories,

the territories where the owner does not own the asset.

@return [nil] if the ownership does not list 'excluded' territories,

# File lib/yt/models/right_owner.rb, line 41
def excluded_territories
  territories if type == 'exclude'
end
included_territories() click to toggle source

Return the list of territories where the owner owns the asset. Each territory is an ISO 3166 two-letter country code. @return [Array<String>] if the ownership lists 'included' territories,

the territories where the owner owns the asset.

@return [nil] if the ownership does not list 'included' territories,

# File lib/yt/models/right_owner.rb, line 32
def included_territories
  territories if type == 'include'
end