Class: Tengine::Core::Session

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps, CollectionAccessible, OptimisticLock
Defined in:
lib/tengine/core/session.rb

Constant Summary

Constants included from OptimisticLock

OptimisticLock::DEFAULT_RETRY_COUNT

Instance Method Summary collapse

Methods included from OptimisticLock

#__update_with_lock__, #update_with_lock, update_with_lock_stack

Methods included from SafeUpdatable

safemode, #update_in_safe_mode

Instance Method Details

#[](key) ⇒ Object

元々の[]と=メソッドをオーバーライドしているので要注意



19
# File 'lib/tengine/core/session.rb', line 19

def [](key); properties[key]; end

#[]=(key, value) ⇒ Object



20
# File 'lib/tengine/core/session.rb', line 20

def []=(key, value); properties[key] = value; end

#clearObject



30
31
32
33
# File 'lib/tengine/core/session.rb', line 30

def clear
  clear_properties
  clear_system_properties
end

#clear_propertiesObject



22
23
24
# File 'lib/tengine/core/session.rb', line 22

def clear_properties
  self.properties = {}
end

#clear_system_propertiesObject



26
27
28
# File 'lib/tengine/core/session.rb', line 26

def clear_system_properties
  self.system_properties = {}
end