Module: Hanami::Action::BodyParser::MultipartForm Private

Defined in:
lib/hanami/action/body_parser/multipart_form.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Body parser for multipart form data (file uploads).

Since:

  • 0.1.0

Class Method Summary collapse

Class Method Details

.call(_body, env) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



12
13
14
15
16
17
18
# File 'lib/hanami/action/body_parser/multipart_form.rb', line 12

def self.call(_body, env)
  # Rack's `parse_multipart` reads the input from the env. We've already rewound this input
  # in BodyParser, before this parser is called.
  ::Rack::Multipart.parse_multipart(env)
rescue StandardError => exception
  raise BodyParsingError, exception.message
end