method
normalize_format
v6.0.0 -
Show latest stable
- Class:
ActionDispatch::Routing::Mapper::Mapping
normalize_format(formatted)private
No documentation available.
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 272
def normalize_format(formatted)
case formatted
when true
{ requirements: { format: /.+/ },
defaults: {} }
when Regexp
{ requirements: { format: formatted },
defaults: { format: nil } }
when String
{ requirements: { format: Regexp.compile(formatted) },
defaults: { format: formatted } }
else
{ requirements: {}, defaults: {} }
end
end