Class: Yt::Models::Policy
- Inherits:
-
Base
- Object
- Base
- Yt::Models::Policy
- 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
-
#description ⇒ String
The policy’s description.
-
#id ⇒ String
The ID that YouTube assigns and uses to uniquely identify the policy.
-
#initialize(options = {}) ⇒ Policy
constructor
A new instance of Policy.
-
#name ⇒ String
The policy’s name.
-
#rules ⇒ 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.
-
#updated_at ⇒ String
The time the policy was updated.
Constructor Details
#initialize(options = {}) ⇒ Policy
Returns a new instance of Policy.
11 12 13 |
# File 'lib/yt/models/policy.rb', line 11 def initialize( = {}) @data = [:data] end |
Instance Method Details
#description ⇒ String
Returns the policy’s description.
23 |
# File 'lib/yt/models/policy.rb', line 23 has_attribute :description |
#id ⇒ String
Returns the ID that YouTube assigns and uses to uniquely identify the policy.
17 |
# File 'lib/yt/models/policy.rb', line 17 has_attribute :id |
#name ⇒ String
Returns the policy’s name.
20 |
# File 'lib/yt/models/policy.rb', line 20 has_attribute :name |
#rules ⇒ Array<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.
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_at ⇒ String
Returns the time the policy was updated.
26 |
# File 'lib/yt/models/policy.rb', line 26 has_attribute :updated_at, type: Time, from: :time_updated |