Module: Hanami::Action::Mime::ClassMethods

Defined in:
lib/hanami/action/mime.rb

Overview

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#format_to_mime_type(format) ⇒ 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.2.0



120
121
122
123
124
# File 'lib/hanami/action/mime.rb', line 120

def format_to_mime_type(format)
  configuration.mime_type_for(format) ||
    MIME_TYPES[format] or
    raise Hanami::Controller::UnknownFormatError.new(format)
end