Class: UzuUzu::RackSession::Cookie

Inherits:
Object
  • Object
show all
Defined in:
lib/uzuuzu-core/rack_session/cookie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env = nil) ⇒ Cookie

Returns a new instance of Cookie.



12
13
14
15
16
17
18
# File 'lib/uzuuzu-core/rack_session/cookie.rb', line 12

def initialize(env=nil)
  @adapter = :cookie
  @secret = 'uzuuzu'
  if env
    @secret = env['secret'] || @secret
  end
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



7
8
9
# File 'lib/uzuuzu-core/rack_session/cookie.rb', line 7

def adapter
  @adapter
end

Instance Method Details

#app(app) ⇒ Object



20
21
22
# File 'lib/uzuuzu-core/rack_session/cookie.rb', line 20

def app(app)
  Rack::Session::Cookie.new(app, :secret => @secret)
end