Class: TelestreamCloud::UploadSession
- Inherits:
-
Object
- Object
- TelestreamCloud::UploadSession
- Defined in:
- lib/telestream_cloud/upload_session.rb
Instance Attribute Summary collapse
-
#uploader ⇒ Object
readonly
Returns the value of attribute uploader.
Instance Method Summary collapse
- #abort ⇒ Object
- #error_message ⇒ Object
- #file_name ⇒ Object
- #file_size ⇒ Object
-
#initialize(file_name, options = {}) ⇒ UploadSession
constructor
A new instance of UploadSession.
- #resume ⇒ Object
- #start(_ = nil) ⇒ Object
- #status ⇒ Object
- #video ⇒ Object
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, = {}) @uploader = Uploader.new(.merge(file: File.new(file_name))) end |
Instance Attribute Details
#uploader ⇒ Object (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
#abort ⇒ Object
37 38 |
# File 'lib/telestream_cloud/upload_session.rb', line 37 def abort end |
#error_message ⇒ Object
9 10 11 |
# File 'lib/telestream_cloud/upload_session.rb', line 9 def uploader.error && uploader.error. end |
#file_name ⇒ Object
29 30 31 |
# File 'lib/telestream_cloud/upload_session.rb', line 29 def file_name uploader.reader.name end |
#file_size ⇒ Object
33 34 35 |
# File 'lib/telestream_cloud/upload_session.rb', line 33 def file_size uploader.reader.size end |
#resume ⇒ Object
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 |
#status ⇒ Object
17 18 19 |
# File 'lib/telestream_cloud/upload_session.rb', line 17 def status uploader.status.to_s end |
#video ⇒ Object
25 26 27 |
# File 'lib/telestream_cloud/upload_session.rb', line 25 def video uploader.video end |