Skip to content

class Athena::Routing::RequestStore
inherits Reference #

Stores the current ART::Request object.

Can be injected to access the request from a non controller context.

require "athena"

@[ADI::Register(public: true)]
class ExampleController < ART::Controller
  def initialize(@request_store : ART::RequestStore); end

  get "/" do
    @request_store.method
  end
end

ART.run

# GET / # => GET

Methods#

#request : ART::Request #

#request=(request : ART::Request) #

View source

#request? : ART::Request? #