Class: Ixtlan::Session

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

Instance Method Summary collapse

Instance Method Details

#dataObject



12
13
14
15
16
17
# File 'lib/ixtlan/session.rb', line 12

def data
  # use string for flash entry to allow the rails flash to work properly !
  d = Marshal.load(::Base64.decode64(attribute_get(:raw_data)))
  d["flash"] = d.delete(:flash)
  d
end

#data=(data) ⇒ Object



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

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