struct Athena::Routing::Params::RequestParam(T)

Overview

Represents form data with a request's body. See ARTA::RequestParam.

Included Modules

Defined in:

params/request_param.cr

Constructors

Instance Method Summary

Instance methods inherited from module Athena::Routing::Params::ParamInterface

constraints : Array(AVD::Constraint) constraints, default default, description : String | Nil description, extract_value(request : HTTP::Request, default : _ = nil) extract_value, incompatibles : Array(String) | Nil incompatibles, name : String name, strict? : Bool strict?

Instance methods inherited from struct Athena::Routing::Params::ScalarParam

constraints : Array(AVD::Constraint) constraints, map? : Bool map?, requirements : AVD::Constraint | Array(AVD::Constraint) | Regex | Nil requirements

Constructor methods inherited from struct Athena::Routing::Params::ScalarParam

new(name : String, has_default : Bool = false, incompatibles : Array(String) | Nil = nil, requirements : AVD::Constraint | Array(AVD::Constraint) | Regex | Nil = nil, map : Bool = false, strict : Bool = true, nilable : Bool = false, key : String | Nil = nil, description : String | Nil = nil) new

Instance methods inherited from struct Athena::Routing::Params::Param

constraints : Array(AVD::Constraint) constraints, description : String | Nil description, has_default? : Bool has_default?, incompatibles : Array(String) | Nil incompatibles, key : String key, name : String name, nilable? : Bool nilable?, strict? : Bool strict?

Constructor methods inherited from struct Athena::Routing::Params::Param

new(name : String, has_default : Bool = false, incompatibles : Array(String) | Nil = nil, strict : Bool = true, nilable : Bool = false, key : String | Nil = nil, description : String | Nil = nil) new

Constructor Detail

def self.new(name : String, has_default : Bool = false, incompatibles : Array(String) | Nil = nil, requirements : AVD::Constraint | Array(AVD::Constraint) | Regex | Nil = nil, map : Bool = false, is_nilable : Bool = false, strict : Bool = true, key : String | Nil = nil, description : String | Nil = nil, default : T | Nil = nil, type : T.class = T, converter : Nil | Nil = nil) #

[View source]

Instance Method Detail

def default : T | Nil #

Returns the value that should be used if #strict? is false and the parameter was not provided, defaulting to nil.


def extract_value(request : HTTP::Request, default : _ = nil) #

Returns the self's value from the provided request, or default if it was not present.


[View source]
def type : T.class #

The type of the parameter, i.e. what its type restriction is.