Class: HelloSign::File

Inherits:
Object
  • Object
show all
Defined in:
lib/hello_sign/file.rb,
lib/hello_sign/file/mime_types.rb

Constant Summary collapse

DEFAULT_MIME_TYPE =
MIME_TYPES.fetch('txt')
MIME_TYPES =
{
  'doc'  => 'application/msword',
  'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  'gif'  => 'image/gif',
  'jpg'  => 'image/jpeg',
  'jpeg' => 'image/jpeg',
  'pdf'  => 'application/pdf',
  'png'  => 'image/png',
  'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
  'ppt'  => 'application/vnd.ms-powerpoint',
  'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
  'tif'  => 'image/tiff',
  'tiff' => 'image/tiff',
  'txt'  => 'text/plain',
  'xls'  => 'application/vnd.ms-excel',
  'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
}

Instance Method Summary collapse

Constructor Details

#initialize(file_data) ⇒ File

Returns a new instance of File.



11
12
13
14
15
# File 'lib/hello_sign/file.rb', line 11

def initialize(file_data)
  @filename  = file_data[:filename]
  @io_object = file_data[:io]
  @mime_type = file_data[:mime]
end

Instance Method Details

#attachmentObject



17
18
19
# File 'lib/hello_sign/file.rb', line 17

def attachment
  Faraday::UploadIO.new(*parameters)
end