Class: Authlogic::ControllerAdapters::SinatraAdapter::Cookies

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

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Cookies) initialize(request, response)

Returns a new instance of Cookies



8
9
10
11
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 8

def initialize(request, response)
  @request = request
  @response = response
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



21
22
23
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 21

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

Instance Attribute Details

- (Object) request (readonly)

Returns the value of attribute request



6
7
8
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 6

def request
  @request
end

- (Object) response (readonly)

Returns the value of attribute response



6
7
8
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 6

def response
  @response
end

Instance Method Details

- (Object) []=(key, options)



17
18
19
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 17

def []=(key, options)
  @response.set_cookie(key, options)
end

- (Object) delete(key, options = {})



13
14
15
# File 'lib/authlogic/controller_adapters/sinatra_adapter.rb', line 13

def delete(key, options = {})
  @response.delete_cookie(key, options)
end