Skip to content

class Athena::Routing::RequestContext
inherits Reference #

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.

View 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.

View 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 = "")#

View source

Methods#

#apply(request : ART::Request) : self#

Updates the properties within self based on the provided request.

View source

#base_url : String#

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

View source

#base_url=(base_url : String) : self#

View source

#has_parameter?(name : String) : Bool#

View source

#host : String#

View source

#host=(host : String) : self#

View source

#http_port : Int32#

View source

#https_port : Int32#

View source

#method : String#

View source

#method=(method : String) : self#

View source

#parameters : Hash(String, String | ::Nil)#

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

View source

#path : String#

View source

#path=(path : String) : self#

View source

#query_string : String#

Returns the query string of the current request.

View source

#query_string=(query_string : String | Nil) : self#

View source

#scheme : String#

View source

#scheme=(scheme : String) : self#

View source

#set_parameter(name : String, value : String | Nil) : self#

View source