2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Validations
|
|
|
|
module Types
|
2020-07-28 23:09:34 +05:30
|
|
|
class WorkhorseFile
|
|
|
|
def self.parse(value)
|
|
|
|
raise "#{value.class} is not an UploadedFile type" unless parsed?(value)
|
|
|
|
|
|
|
|
value
|
2019-12-04 20:38:33 +05:30
|
|
|
end
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
def self.parsed?(value)
|
2019-12-04 20:38:33 +05:30
|
|
|
value.is_a?(::UploadedFile)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|