struct

Tourmaline::Middleware::Context

Inherits Struct < Value < Object

Constructors

Instance methods

get(name, type : T.class) forall T

Returns the value of the parameter with the provided name as a type.

Source
get(name)

Returns the value of the parameter with the provided name.

Raises a KeyError if no parameter with that name exists.

Source
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.

Source
get?(name)

Returns the value of the parameter with the provided name if it exists, otherwise nil.

Source
has?(name) : Bool

Returns true if a parameter with the provided name exists, otherwise false.

Source
initialize
Source
remove(name) : Nil

Removes the parameter with the provided name.

Source
set(name, value : _, type : T.class) : Nil forall T

Sets a parameter with the provided name to value, restricted to the given type.

Source
set(name, value : T) : Nil forall T

Sets a parameter with the provided name to value.

Source
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.

Source
set(name, &block : -> T) : Nil forall T

Sets a lazy parameter with the provided name to the return value of the provided block.

Source