Class: Tengine::Core::SessionWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/tengine/core/session_wrapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(source, options = {}) ⇒ SessionWrapper

Returns a new instance of SessionWrapper.



9
10
11
12
# File 'lib/tengine/core/session_wrapper.rb', line 9

def initialize(source, options = {})
  @options = options || {}
  @source = source
end

Instance Method Details

#[](key) ⇒ Object



18
19
20
# File 'lib/tengine/core/session_wrapper.rb', line 18

def [](key)
  @source.properties[key.to_s]
end

#clearObject



36
37
38
39
# File 'lib/tengine/core/session_wrapper.rb', line 36

def clear
  @source.reload
  @source.clear
end

#clear!Object



40
41
42
43
# File 'lib/tengine/core/session_wrapper.rb', line 40

def clear!
  clear
  @source.save!
end

#reloadObject



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

def reload
  @source.reload
end

#system_propertiesObject



14
15
16
# File 'lib/tengine/core/session_wrapper.rb', line 14

def system_properties
  @source.system_properties
end

#system_update(*args, &block) ⇒ Object



27
28
29
# File 'lib/tengine/core/session_wrapper.rb', line 27

def system_update(*args, &block)
  __update__(:system_properties, *args, &block)
end

#update(*args, &block) ⇒ Object



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

def update(*args, &block)
  return if @options[:ignore_update]
  __update__(:properties, *args, &block)
end