Class: ConvertApi::UploadIO

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

Instance Method Summary collapse

Constructor Details

#initialize(io, filename = nil) ⇒ UploadIO

Returns a new instance of UploadIO.



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

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

Instance Method Details

#file_extObject



22
23
24
# File 'lib/convert_api/upload_io.rb', line 22

def file_ext
  result['FileExt']
end

#file_idObject



14
15
16
# File 'lib/convert_api/upload_io.rb', line 14

def file_id
  result['FileId']
end

#file_nameObject



18
19
20
# File 'lib/convert_api/upload_io.rb', line 18

def file_name
  result['FileName']
end

#to_sObject



10
11
12
# File 'lib/convert_api/upload_io.rb', line 10

def to_s
  file_id
end