Class: Zype::Videos

Inherits:
BaseModel show all
Defined in:
lib/zype/models/videos.rb

Overview

Since:

  • 0.4.0

Constant Summary

Constants inherited from BaseModel

BaseModel::ACCEPTED_KEYS

Instance Attribute Summary

Attributes inherited from BaseModel

#client, #path

Instance Method Summary collapse

Methods inherited from BaseModel

#all, #auth=, #create, #delete, #find, #initialize, #update

Constructor Details

This class inherits a constructor from Zype::BaseModel

Instance Method Details

#add_zobjects(id:, zobject_ids:) ⇒ Hash

Adds zobjects to video

Parameters:

  • id (String)

    the ID of the video

  • zobject_ids (Array<String>)

    an array of zobject IDs

Returns:

  • (Hash)

    the video object

Since:

  • 0.4.0



11
12
13
# File 'lib/zype/models/videos.rb', line 11

def add_zobjects(id:, zobject_ids:)
  client.execute(method: :put, path: "/videos/#{id}/add_zobjects", params: { zobject_id: zobject_ids })
end

#download(id:) ⇒ Hash

Returns the original source file for the video

Parameters:

  • id (String)

    the ID of the video

Returns:

  • (Hash)

    object containing a “url” key for the original source file

Since:

  • 0.4.0



28
29
30
# File 'lib/zype/models/videos.rb', line 28

def download(id:)
  client.execute(method: :get, path: "/videos/#{id}/download")
end

#remove_zobjects(id:, zobject_ids:) ⇒ Hash

Removes zobjects from video

Parameters:

  • id (String)

    the ID of the video

  • zobject_ids (Array<String>)

    an array of zobject IDs

Returns:

  • (Hash)

    the video object

Since:

  • 0.4.0



20
21
22
# File 'lib/zype/models/videos.rb', line 20

def remove_zobjects(id:, zobject_ids:)
  client.execute(method: :put, path: "/videos/#{id}/remove_zobjects", params: { zobject_id: zobject_ids })
end