class Athena::HTTPKernel::Controller::ValueResolvers::Session
inherits Reference
#
Handles resolving a value for action parameters typed as AHTTP::Session, if the request has a session.
@[ARTA::Get("/")]
def visits(session : AHTTP::Session) : Int32
visits = (session.get?("visits", Int32) || 0) + 1
session.set "visits", visits
visits
end
Included modules
Athena::HTTPKernel::Controller::ValueResolvers::Interface
Methods#
#resolve(request : AHTTP::Request, parameter : AHK::Controller::ParameterMetadata) : AHTTP::Session | Nil#
Returns a value resolved from the provided request and parameter if possible, otherwise returns nil if no parameter could be resolved.