Class: API::Validations::Types::WorkhorseFile

Inherits:
Object
  • Object
show all
Defined in:
lib/api/validations/types/workhorse_file.rb

Class Method Summary collapse

Class Method Details

.parse(value) ⇒ Object


7
8
9
10
11
# File 'lib/api/validations/types/workhorse_file.rb', line 7

def self.parse(value)
  raise "#{value.class} is not an UploadedFile type" unless parsed?(value)

  value
end

.parsed?(value) ⇒ Boolean

Returns:

  • (Boolean)

13
14
15
# File 'lib/api/validations/types/workhorse_file.rb', line 13

def self.parsed?(value)
  value.is_a?(::UploadedFile)
end