class TrackerApi::FileUtility
Public Class Methods
check_files_exist(files)
click to toggle source
# File lib/tracker_api/file_utility.rb, line 9 def check_files_exist(files) files.each do | file | raise ArgumentError, 'Attachment file not found.' unless Pathname.new(file).exist? end end
get_file_upload(file)
click to toggle source
# File lib/tracker_api/file_utility.rb, line 4 def get_file_upload(file) mime_type = MiniMime.lookup_by_filename(file) { :file => Faraday::UploadIO.new(file, mime_type) } end