Skip to content

class Athena::Framework::RequestStore
inherits Reference #

Stores the current ATH::Request object.

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

require "athena"

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

  get "/" do
    @request_store.method
  end
end

ATH.run

# GET / # => GET

Methods#

#request : ATH::Request#

#request=(request : ATH::Request)#

View source

#request? : ATH::Request | ::Nil#