Skip to content

struct Athena::Routing::Arguments::Resolvers::DefaultValue
inherits Struct #

Handles resolving an argument's default value if no other value was able to be resolved.

@[ARTA::Get("/")]
@[ARTA::QueryParam("query_param")]
def get_query_param(query_param : Int32 = 123) : Int32
  # `query_param` would be `123` if the request does not include a query parameter named `query_param`.
  query_param
end

Included modules

Athena::Routing::Arguments::Resolvers::ArgumentValueResolverInterface

Class methods#

.new #

View source

Methods#

#resolve(request : ART::Request, argument : ART::Arguments::ArgumentMetadata) #

Returns a value resolved from the provided request and argument.

View source

#supports?(request : ART::Request, argument : ART::Arguments::ArgumentMetadata) : Bool #

Returns true if self is able to resolve a value from the provided request and argument.

View source