Class: Yt::Collections::ResumableSessions

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

Overview

Provides methods to upload videos with the resumable upload protocol.

Resources with resumable sessions are: accounts.

Instance Method Summary collapse

Methods inherited from Base

#initialize, of, #where

Methods included from Actions::List

#first!

Constructor Details

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

Instance Method Details

#insert(content_length, body = {}) ⇒ Object

Starts a resumable session by sending to YouTube the metadata of the object to upload. If the request succeeds, YouTube returns a unique URL to upload the object file (and eventually resume the upload).

Parameters:

  • content_length (Integer)

    the size (bytes) of the object to upload.

  • options (Hash)

    the metadata to add to the uploaded object.



18
19
20
21
# File 'lib/yt/collections/resumable_sessions.rb', line 18

def insert(content_length, body = {})
  @headers = headers_for content_length
  do_insert body: body, headers: @headers
end