class URITemplate::Template
- URITemplate::Template
- Reference
- Object
Defined in:
uri_template/template.crConstructors
Class Method Summary
-
.parse(str : String) : Array(String | URIVariable)
Parse the template, looking for bracketed expressions.
Instance Method Summary
-
#==(other) : Bool
Check equality by comparing the URI field.
-
#expand(var_hash : VariableValueHash | Nil = nil, **kwargs) : String
Expand the URI with the +var_hash+, keyword arguments a mix of the two.
-
#expand_partial(var_hash : VariableValueHash | Nil = nil, **kwargs) : Template
Partial expansions should return another Template object.
-
#to_s : String
The original URI String.
-
#uri : String
Gets the original URI string used to construct the Template object
-
#variable_names : Set(String)
A set of unique variable names in this template
-
#variables
Retrieves the Components that are URIVariables
Constructor Detail
Class Method Detail
Parse the template, looking for bracketed expressions. In a quick survey of other implementations, many seem to use Regex's to parse the template, however it's hard to pinpoint errors in the input template using Regex ("do or do not, there is no try").
Instance Method Detail
Expand the URI with the +var_hash+, keyword arguments a mix of the two. Complete expansions return a String.
Partial expansions should return another Template object.