Class: Smartsheet::API::ObjectFileSpec

Inherits:
Object
  • Object
show all
Defined in:
lib/smartsheet/api/file_spec.rb

Overview

Specification for a file attachment by File, target filename, file length, and MIME content type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, filename, file_length, content_type) ⇒ ObjectFileSpec

Returns a new instance of ObjectFileSpec.



23
24
25
26
27
28
# File 'lib/smartsheet/api/file_spec.rb', line 23

def initialize(file, filename, file_length, content_type)
  @file_length = file_length
  @filename = filename
  @upload_io = Faraday::UploadIO.new(file, content_type, CGI::escape(filename))
  @content_type = content_type
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



21
22
23
# File 'lib/smartsheet/api/file_spec.rb', line 21

def content_type
  @content_type
end

#file_lengthObject (readonly)

Returns the value of attribute file_length.



21
22
23
# File 'lib/smartsheet/api/file_spec.rb', line 21

def file_length
  @file_length
end

#filenameObject (readonly)

Returns the value of attribute filename.



21
22
23
# File 'lib/smartsheet/api/file_spec.rb', line 21

def filename
  @filename
end

#upload_ioObject (readonly)

Returns the value of attribute upload_io.



21
22
23
# File 'lib/smartsheet/api/file_spec.rb', line 21

def upload_io
  @upload_io
end