Class: TelestreamCloud::UploadSession

Inherits:
Object
  • Object
show all
Defined in:
lib/telestream_cloud/upload_session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name, options = {}) ⇒ UploadSession

Returns a new instance of UploadSession.



5
6
7
# File 'lib/telestream_cloud/upload_session.rb', line 5

def initialize(file_name, options = {})
  @uploader = Uploader.new(options.merge(file: File.new(file_name)))
end

Instance Attribute Details

#uploaderObject (readonly)

Returns the value of attribute uploader.



3
4
5
# File 'lib/telestream_cloud/upload_session.rb', line 3

def uploader
  @uploader
end

Instance Method Details

#abortObject



37
38
# File 'lib/telestream_cloud/upload_session.rb', line 37

def abort
end

#error_messageObject



9
10
11
# File 'lib/telestream_cloud/upload_session.rb', line 9

def error_message
  uploader.error && uploader.error.message
end

#file_nameObject



29
30
31
# File 'lib/telestream_cloud/upload_session.rb', line 29

def file_name
  uploader.reader.name
end

#file_sizeObject



33
34
35
# File 'lib/telestream_cloud/upload_session.rb', line 33

def file_size
  uploader.reader.size
end

#resumeObject



21
22
23
# File 'lib/telestream_cloud/upload_session.rb', line 21

def resume
  start
end

#start(_ = nil) ⇒ Object



13
14
15
# File 'lib/telestream_cloud/upload_session.rb', line 13

def start(_ = nil)
  uploader.upload
end

#statusObject



17
18
19
# File 'lib/telestream_cloud/upload_session.rb', line 17

def status
  uploader.status.to_s
end

#videoObject



25
26
27
# File 'lib/telestream_cloud/upload_session.rb', line 25

def video
  uploader.video
end