Class: Yt::Collections::Claims

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/collections/claims.rb

Overview

Provides methods to interact with a collection of Content ID claims.

Resources with claims are: content owners.

Instance Method Summary collapse

Methods inherited from Base

#includes, #initialize, of, #where

Constructor Details

This class inherits a constructor from Yt::Collections::Base

Instance Method Details

#insert(attributes = {}) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/yt/collections/claims.rb', line 10

def insert(attributes = {})
  underscore_keys! attributes
  body = attributes.slice :asset_id, :video_id, :content_type, :policy
  body[:policy] = {id: attributes[:policy_id]} if attributes[:policy_id]
  body[:match_info] = match_attributes(attributes[:match_info]) if attributes[:match_info]
  params = attributes.slice(:is_manual_claim).merge({on_behalf_of_content_owner: @auth.owner_name})
  do_insert(params: params, body: body)
end