Class: Ixtlan::SessionWithCache

Inherits:
DataMapper::Session::Abstract::Session
  • Object
show all
Defined in:
lib/ixtlan/session_with_cache.rb

Instance Method Summary collapse

Instance Method Details

#dataObject



14
15
16
17
# File 'lib/ixtlan/session_with_cache.rb', line 14

def data
  # use string key for flash entry to allow the rails flash to work properly !
  Marshal.load(::Base64.decode64(attribute_get(:raw_data))).merge({:user => @user, "flash" => @flash, :expires_at => @expires_at})
end

#data=(data) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/ixtlan/session_with_cache.rb', line 5

def data=(data)
  d = {}
  data.each{|k,v| d[k.to_sym] = v}
  @user = d.delete(:user)
  @flash = d.delete(:flash)
  @expires_at = d.delete(:expires_at)
  attribute_set(:raw_data, ::Base64.encode64(Marshal.dump(d)))
end