Parsed documentation:
View on GitHub
@note This method is only implemented by certain subclasses.

Generates a list of URI template strings representing the pattern.

Note that this transformation is lossy and the strings matching these
templates might not match the pattern (and vice versa).

This comes in quite handy since URI templates are not made for pattern matching.
That way you can easily use a more precise template syntax and have it automatically
generate hypermedia links for you.

@example generating templates"/:name").to_templates                   # => ["/{name}"]"/:foo(@:bar)?/*baz").to_templates       # => ["/{foo}@{bar}/{+baz}", "/{foo}/{+baz}"]"/{name}", type: :template).to_templates # => ["/{name}"]

@example generating templates from composite patterns
  pattern  ='/:name')
  pattern |='/{name}', type: :template)
  pattern |='/example/*nested')
  pattern.to_templates # => ["/{name}", "/example/{+nested}"]

Template generation is supported by almost all patterns (notable exceptions are
{Mustermann::Shell}, {Mustermann::Regular} and {Mustermann::Simple}).
Union {Mustermann::Composite} patterns (with the | operator) support template generation
if all patterns they are composed of also support it.

@example Checking if a pattern supports expanding
  if pattern.respond_to? :to_templates
    warn "does not support template generation"

@return [Array<String>] list of URI templates
No suggestions.
Please help! Open an issue on GitHub if this assessment is incorrect.