Skip to content

module Athena::Framework::Controller::ValueResolvers #

This type includes all of the built-in resolvers that Athena uses to try and resolve an argument for a particular controller action parameter. They run in the following order:

  1. ATHR::Enum (105) - Attempts to resolve a value from ATH::Request#attributes into an enum member of the related type. Works well in conjunction with ART::Requirement::Enum.

  2. ATHR::Time (105) - Attempts to resolve a value from the request attributes into a ::Time instance, defaulting to RFC 3339. Format/location can be customized via the ATHR::Time::Format annotation.

  3. ATHR::UUID (105) - Attempts to resolve a value from the request attributes into a ::UUID instance.

  4. ATHR::RequestBody (105) - If enabled, attempts to deserialize the request body into the type of the related parameter, running any validations, if any.

  5. ATHR::RequestAttribute (100) - Provides a value stored in ATH::Request#attributes if one with the same name as the action parameter exists.

  6. ATHR::Request (50) - Provides the current ATH::Request if the related parameter is typed as such.

  7. ATHR::DefaultValue (-100) - Provides the default value of the parameter if it has one, or nil if it is nilable.

See each resolver for more detailed information. Custom resolvers may also be defined. See ATHR::Interface for more information.