Tourmaline::Middleware::Context
Constructors
new
SourceInstance methods
get(name, type : T.class) forall T
Returns the value of the parameter with the provided name as a type.
get(name)
Returns the value of the parameter with the provided name.
Raises a KeyError if no parameter with that name exists.
get?(name, type : T.class) forall T
Returns the value of the parameter with the provided name as a type if it exists, otherwise nil.
get?(name)
Returns the value of the parameter with the provided name if it exists, otherwise nil.
initialize
Sourceset(name, value : _, type : T.class) : Nil forall T
Sets a parameter with the provided name to value, restricted to the given type.
set(name, type : T.class, &block : -> T) : Nil forall T
Sets a lazy parameter with the provided name to the return value of the provided block, restricted to the given type.
set(name, &block : -> T) : Nil forall T
Sets a lazy parameter with the provided name to the return value of the provided block.