struct Athena::Routing::Arguments::Resolvers::DefaultValue
- Athena::Routing::Arguments::Resolvers::DefaultValue
- Struct
- Value
- Object
Overview
Handles resolving an argument's default value if no other value was able to be resolved.
@[ART::Get("/")]
@[ART::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
Defined in:
arguments/resolvers/default_value_resolver.crConstructors
Instance Method Summary
- #initialize
-
#resolve(request : HTTP::Request, argument : ART::Arguments::ArgumentMetadata)
Returns a value resolved from the provided request and argument.
-
#supports?(request : HTTP::Request, argument : ART::Arguments::ArgumentMetadata) : Bool
Returns
true
ifself
is able to resolve a value from the provided request and argument.
Instance methods inherited from module Athena::Routing::Arguments::Resolvers::ArgumentValueResolverInterface
resolve(request : HTTP::Request, argument : ART::Arguments::ArgumentMetadata)
resolve,
supports?(request : HTTP::Request, argument : ART::Arguments::ArgumentMetadata) : Bool
supports?
Constructor Detail
Instance Method Detail
Returns a value resolved from the provided request and argument.
Returns true
if self
is able to resolve a value from the provided request and argument.