class

Athena::Routing::RequestContext

Inherits Reference < Object

Represents data from a request in an agnostic manner, primarily used to augment URL matching and generation with additional context.

Constructors

from_uri(uri : String, host : String = "localhost", scheme : String = "http", http_port : Int32 = 80, https_port : Int32 = 443) : self

Creates a new instance of self from the provided uri. The host, scheme, http_port, and https_port optionally act as fallbacks if they are not contained within the uri.

Source
from_uri(uri : URI, host : String = "localhost", scheme : String = "http", http_port : Int32 = 80, https_port : Int32 = 443) : self

Creates a new instance of self from the provided uri. The host, scheme, http_port, and https_port optionally act as fallbacks if they are not contained within the uri.

Source
new(base_url : String = "", method : String = "GET", host : String = "localhost", scheme : String = "http", http_port : Int32 = 80, https_port : Int32 = 443, path : String = "/", query_string : String = "")
Source

Instance methods

apply(request : ART::Request) : self

Updates the properties within self based on the provided request.

Source
base_url

Represents the path of the URL before #path. E.g. a path that should be prefixed to all other #paths.

Source
base_url=(base_url : String) : self
Source
has_parameter?(name : String) : Bool
Source
host
Source
host=(host : String) : self
Source
http_port
Source
http_port=(http_port : Int32) : self
Source
https_port
Source
https_port=(https_port : Int32) : self
Source
method
Source
method=(method : String) : self
Source
parameter(name : String)
Source
parameters

Returns the global parameters that should be used as part of the URL generation logic.

Source
parameters=(parameters : Hash(String, String | Nil)) : self
Source
path
Source
path=(path : String) : self
Source
query_string

Returns the query string of the current request.

Source
query_string=(query_string : String | Nil) : self
Source
scheme
Source
scheme=(scheme : String) : self
Source
set_parameter(name : String, value : String | Nil) : self
Source