class

URITemplate::Template

Inherits Reference < Object

Constructors

new(uri : String)
Source

Class methods

parse(str : String) : Array(String | URIVariable)

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").

Source

Instance methods

==(other) : Bool

Check equality by comparing the URI field.

Source
expand(var_hash : VariableValueHash | Nil = nil, **kwargs) : String

Expand the URI with the +var_hash+, keyword arguments a mix of the two. Complete expansions return a String.

Source
expand_partial(var_hash : VariableValueHash | Nil = nil, **kwargs) : Template

Partial expansions should return another Template object.

Source
to_s

The original URI String.

Source
uri

Gets the original URI string used to construct the Template object

Source
variable_names

A set of unique variable names in this template

Source
variables

Retrieves the Components that are URIVariables

Source