lib/smartsheet/api/file_spec.rb in smartsheet-1.0.0.beta.2 vs lib/smartsheet/api/file_spec.rb in smartsheet-1.0.0
- old
+ new
@@ -1,10 +1,11 @@
require 'cgi'
require 'faraday'
module Smartsheet
module API
+ # Specification for a file attachment by path, target filename, and MIME content type
class PathFileSpec
attr_reader :upload_io, :filename, :content_type, :file_length
def initialize(path, filename, content_type)
@file_length = File.size(path)
@@ -12,9 +13,11 @@
@upload_io = Faraday::UploadIO.new(path, content_type, CGI::escape(@filename))
@content_type = content_type
end
end
+ # Specification for a file attachment by {::File}, target filename, file length, and MIME
+ # content type
class ObjectFileSpec
attr_reader :upload_io, :filename, :content_type, :file_length
def initialize(file, filename, file_length, content_type)
@file_length = file_length
\ No newline at end of file