Class: Yt::Models::Policy
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
(also: #time_updated)
The time the policy was updated.
Methods included from Associations::HasReports
Methods included from Associations::HasViewerPercentages
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
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.
27 28 29 |
# File 'lib/yt/models/policy.rb', line 27 def description @name ||= @data['description'] end |
#id ⇒ String
Returns the ID that YouTube assigns and uses to uniquely identify the policy.
17 18 19 |
# File 'lib/yt/models/policy.rb', line 17 def id @id ||= @data['id'] end |
#name ⇒ String
Returns the policy’s name.
22 23 24 |
# File 'lib/yt/models/policy.rb', line 22 def name @name ||= @data['name'] end |
#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.
40 41 42 |
# File 'lib/yt/models/policy.rb', line 40 def rules @rules ||= @data['rules'].map{|rule| PolicyRule.new data: rule} end |
#updated_at ⇒ String Also known as: time_updated
Returns the time the policy was updated.
32 33 34 |
# File 'lib/yt/models/policy.rb', line 32 def updated_at @updated_at ||= Time.parse @data['timeUpdated'] end |