Class: Authlogic::ControllerAdapters::SinatraAdapter::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/authlogic/controller_adapters/sinatra_adapter.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Controller) initialize(request, response)

Returns a new instance of Controller



29
30
31
32
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 29

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

- (Object) method_missing(meth, *args, &block)



38
39
40
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 38

def method_missing(meth, *args, &block)
  @request.send meth, *args, &block
end

Instance Attribute Details

- (Object) cookies (readonly)

Returns the value of attribute cookies



27
28
29
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 27

def cookies
  @cookies
end

- (Object) request (readonly)

Returns the value of attribute request



27
28
29
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 27

def request
  @request
end

- (Object) response (readonly)

Returns the value of attribute response



27
28
29
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 27

def response
  @response
end

Instance Method Details

- (Object) session



34
35
36
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 34

def session
  env['rack.session']
end