Class: Authlogic::ControllerAdapters::SinatraAdapter::Controller
- Inherits:
-
Object
- Object
- Authlogic::ControllerAdapters::SinatraAdapter::Controller
- Defined in:
- lib/authlogic/controller_adapters/sinatra_adapter.rb
Overview
Thin wrapper around request and response.
Instance Attribute Summary collapse
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(request, response) ⇒ Controller
constructor
A new instance of Controller.
- #method_missing(meth, *args, &block) ⇒ Object
- #session ⇒ Object
Constructor Details
#initialize(request, response) ⇒ Controller
Returns a new instance of Controller.
33 34 35 36 |
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 33 def initialize(request, response) @request = request @cookies = Cookies.new(request, response) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
42 43 44 |
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 42 def method_missing(meth, *args, &block) @request.send meth, *args, &block end |
Instance Attribute Details
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
31 32 33 |
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 31 def @cookies end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
31 32 33 |
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 31 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
31 32 33 |
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 31 def response @response end |
Instance Method Details
#session ⇒ Object
38 39 40 |
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 38 def session env["rack.session"] end |