ActionController::MCPServer::URITemplate
Inherits Reference < Object
the subset of RFC 6570 URI templates used by
resource templates: simple {name} expansions, which never span a /, and a trailing
form style query {?name,other}
template = URITemplate.new("app://widgets/{id}/logs{?seconds}")
template.match("app://widgets/12/logs?seconds=30") # => {"id" => "12", "seconds" => "30"}
Constructors
new(template : String)
SourceInstance methods
match(uri : String) : Hash(String, String) | Nil
the variables of a matching URI, percent decoded, otherwise nil. Query params
that aren't template variables don't match
specificity
sorts templates so the most specific are matched first: those with fewer variables, then longer literals
template
Source