method

normalize_format

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActionDispatch::Routing::Mapper::Mapping
normalize_format(formatted) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 243
          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
Register or log in to add new notes.