Class: Yt::Models::Policy

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

Overview

Provides methods to interact with YouTube ContentID policies. A policy resource specifies rules that define a particular usage or match policy that a partner can associate with an asset or claim.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Policy

Returns a new instance of Policy.


11
12
13
# File 'lib/yt/models/policy.rb', line 11

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

Instance Method Details

#descriptionString

Returns the policy’s description.

Returns:

  • (String)

    the policy’s description.


23
# File 'lib/yt/models/policy.rb', line 23

has_attribute :description

#idString

Returns the ID that YouTube assigns and uses to uniquely identify the policy.

Returns:

  • (String)

    the ID that YouTube assigns and uses to uniquely identify the policy.


17
# File 'lib/yt/models/policy.rb', line 17

has_attribute :id

#nameString

Returns the policy’s name.

Returns:

  • (String)

    the policy’s name.


20
# File 'lib/yt/models/policy.rb', line 20

has_attribute :name

#rulesArray<PolicyRule>

Returns a list of rules that specify the action that YouTube should take and may optionally specify the conditions under which that action is enforced.

Returns:

  • (Array<PolicyRule>)

    a list of rules that specify the action that YouTube should take and may optionally specify the conditions under which that action is enforced.


31
32
33
# File 'lib/yt/models/policy.rb', line 31

has_attribute :rules do |rules|
  rules.map{|rule| PolicyRule.new data: rule}
end

#updated_atString

Returns the time the policy was updated.

Returns:

  • (String)

    the time the policy was updated.


26
# File 'lib/yt/models/policy.rb', line 26

has_attribute :updated_at, type: Time, from: :time_updated