Class: Google::APIClient::UploadIO

Inherits:
Faraday::UploadIO
  • Object
show all
Defined in:
lib/google/api_client/media.rb

Overview

Uploadable media support. Holds an IO stream & content type.

Examples:

media = Google::APIClient::UploadIO.new('mymovie.m4v', 'video/mp4')

See Also:

  • Faraday::UploadIO

Instance Method Summary collapse

Instance Method Details

#lengthInteger

Get the length of the stream

Returns:

  • (Integer)

    Length of stream, in bytes



28
29
30
# File 'lib/google/api_client/media.rb', line 28

def length
  io.respond_to?(:length) ? io.length : File.size(local_path)
end