Module: Paramore::File

Defined in:
lib/paramore/types.rb

Constant Summary collapse

VALID_CLASSES =
[
  File,
  StringIO,
  Rack::Test::UploadedFile,
  ActionDispatch::Http::UploadedFile,
].freeze

Class Method Summary collapse

Class Method Details

.[](input) ⇒ Object



80
81
82
83
84
# File 'lib/paramore/types.rb', line 80

def [](input)
  raise "#{input.class} is not a file!" unless input.class.in?(VALID_CLASSES)

  input
end