Class: ConvertApi::UploadIO

Inherits:
Object
  • Object
show all
Defined in:
lib/convert_api/upload_io.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io, filename = nil) ⇒ UploadIO



7
8
9
10
# File 'lib/convert_api/upload_io.rb', line 7

def initialize(io, filename = nil)
  @io = io
  @filename = filename || io_filename || raise(FileNameError, 'IO filename must be provided')
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



5
6
7
# File 'lib/convert_api/upload_io.rb', line 5

def filename
  @filename
end

#ioObject (readonly)

Returns the value of attribute io.



5
6
7
# File 'lib/convert_api/upload_io.rb', line 5

def io
  @io
end

Instance Method Details

#file_idObject



16
17
18
# File 'lib/convert_api/upload_io.rb', line 16

def file_id
  @file_id ||= upload_file['FileId']
end

#to_sObject



12
13
14
# File 'lib/convert_api/upload_io.rb', line 12

def to_s
  file_id
end