Parsed documentation:
View on GitHub
Creates a new pattern based on input.

* From {Mustermann::Pattern}: returns given pattern.
* From String: creates a pattern from the string, depending on type option (defaults to {Mustermann::Sinatra})
* From Regexp: creates a {Mustermann::Regular} pattern.
* From Symbol: creates a {Mustermann::Sinatra} pattern with a single named capture named after the input.
* From an Array or multiple inputs: creates a new pattern from each element, combines them to a {Mustermann::Composite}.
* From anything else: Will try to call to_pattern on it or raise a TypeError.

Note that if the input is a {Mustermann::Pattern}, Regexp or Symbol, the type option is ignored and if to_pattern is
called on the object, the type will be handed on but might be ignored by the input object.

If you want to enforce the pattern type, you should create them via their expected class.

@example creating patterns
  require 'mustermann'"/:name")                    # => #<Mustermann::Sinatra:"/example">"/{name}", type: :template)  # => #<Mustermann::Template:"/{name}">*/)                        # => #<Mustermann::Regular:".*">, capture: :word)       # => #<Mustermann::Sinatra:":name">"/", "/*.jpg", type: :shell) # => #<Mustermann::Composite:(shell:"/" | shell:"/*.jpg")>

@example using custom #to_pattern
  require 'mustermann'

  class MyObject
    def to_pattern(**options)"/:name", **options)
  end, type: :rails) # => #<Mustermann::Rails:"/:name">

@example enforcing type
  require 'mustermann/sinatra'"/:name")

@param [String, Pattern, Regexp, Symbol, #to_pattern, Array<String, Pattern, Regexp, Symbol, #to_pattern>]
  input The representation of the pattern
@param [Hash] options The options hash
@return [Mustermann::Pattern] pattern corresponding to string.
@raise (see [])
@raise (see
@raise [TypeError] if the passed object cannot be converted to a pattern
@see "Types and Options" in the README
Please help! Open an issue on GitHub if this assessment is incorrect.