class Athena::HTTPKernel::Action(ReturnType, ParameterTypeTuple, ParametersType)
inherits Athena::HTTPKernel::ActionBase
#
Represents a controller action that will handle a request.
Includes metadata about the endpoint, such as its action parameters and return type, and the action that should be executed.
Constructors#
.new(action : Proc(ParameterTypeTuple, ReturnType), parameters : ParametersType, _return_type : ReturnType.class)#
Methods#
#execute(arguments : Array) : ReturnType#
Executes this action with the provided arguments array.
#parameters : ParametersType#
Returns a tuple of AHK::Controller::ParameterMetadata representing the parameters this action expects.
#resolve_arguments(value_resolvers : Array, request : AHTTP::Request) : Array#
Resolves the arguments for this action for the given request.
This is defined in here as opposed to AHK::Controller::ArgumentResolver so that the free vars are resolved correctly.
See https://forum.crystal-lang.org/t/incorrect-overload-selected-with-freevar-and-generic-inheritance/3625.