class Athena::Routing::RequestContext
- Athena::Routing::RequestContext
- Reference
- Object
Overview
Represents data from a request in an agnostic manner, primarily used to augment URL matching and generation with additional context.
Defined in:
request_context.crConstructors
-
.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.
-
.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.
- .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 = "")
Instance Method Summary
-
#apply(request : ART::Request) : self
Updates the properties within
self
based on the provided request. -
#base_url : String
Represents the path of the URL before
#path
. - #base_url=(base_url : String) : self
- #has_parameter?(name : String) : Bool
- #host : String
- #host=(host : String) : self
- #http_port : Int32
- #http_port=(http_port : Int32) : self
- #https_port : Int32
- #https_port=(https_port : Int32) : self
- #method : String
- #method=(method : String) : self
- #parameter(name : String)
-
#parameters : Hash(String, String | Nil)
Returns the global parameters that should be used as part of the URL generation logic.
- #parameters=(parameters : Hash(String, String | Nil)) : self
- #path : String
- #path=(path : String) : self
-
#query_string : String
Returns the query string of the current request.
- #query_string=(query_string : String | Nil) : self
- #scheme : String
- #scheme=(scheme : String) : self
- #set_parameter(name : String, value : String | Nil) : self
Constructor Detail
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.
ameba:disable Metrics/CyclomaticComplexity:
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.
ameba:disable Metrics/CyclomaticComplexity:
Instance Method Detail
Updates the properties within self
based on the provided request.
Represents the path of the URL before #path
.
E.g. a path that should be prefixed to all other #path
s.
Returns the global parameters that should be used as part of the URL generation logic.