Skip to content

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

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

@[ATHA::Get("/")]
@[ATHA::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::Framework::Arguments::Resolvers::ArgumentValueResolverInterface

Constructors#

.new #

View source

Methods#

#initialize #

View source

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

Returns a value resolved from the provided request and argument.

View source

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

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

View source