Parsed documentation:
View on GitHub
Allows you to register your own converters.

It is reommended to use this on a subclass, so to not influence other subsystems
using flask templates.

The object passed in as converter can implement #convert and/or #constraint.

It can also instead implement #new, which will then return an object responding
to some of these methods. Arguments from the flask pattern will be passed to #new.

If passed a block, it will be yielded to with a {Mustermann::Flask::Converter}
instance and any arguments in the flask pattern.

@example with simple object
  require 'mustermann/flask'

  MyPattern    =
  up_converter =
  MyPattern.register_converter(:upper, up_converter)"/<up:name>").params('/foo') # => { "name" => "FOO" }

@example with block
  require 'mustermann/flask'

  MyPattern    =
  MyPattern.register_converter(:upper) { |c| c.convert = :upcase.to_proc }"/<up:name>").params('/foo') # => { "name" => "FOO" }

@example with converter class
  require 'mustermann/flasl'

  class MyPattern < Mustermann::Flask
    class Converter
      attr_reader :convert
      def initialize(send: :to_s)
        @convert = send.to_sym.to_proc

    register_converter(:t, Converter)
  end"/<t(send=upcase):name>").params('/Foo')   # => { "name" => "FOO" }"/<t(send=downcase):name>").params('/Foo') # => { "name" => "foo" }

@param [#to_s] name converter name
@param [#new, #convert, #constraint, nil] converter
Please help! Open an issue on GitHub if this assessment is incorrect.