Method: Hanami::Controller::Configuration#default_request_format
- Defined in:
- lib/hanami/controller/configuration.rb
#default_request_format(format) ⇒ Object #default_request_format ⇒ Symbol?
Set a format as default fallback for all the requests without a strict requirement for the mime type.
The given format must be coercible to a symbol, and be a valid mime type alias. If it isn’t, at the runtime the framework will raise a Hanami::Controller::UnknownFormatError.
By default this value is nil.
This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding instance variable. When called without, it will return the already set value, or the default.
487 488 489 490 491 492 493 |
# File 'lib/hanami/controller/configuration.rb', line 487 def default_request_format(format = nil) if format @default_request_format = Utils::Kernel.Symbol(format) else @default_request_format end end |