Class: Tengine::Core::SessionWrapper
- Inherits:
-
Object
- Object
- Tengine::Core::SessionWrapper
- Defined in:
- lib/tengine/core/session_wrapper.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #clear ⇒ Object
- #clear! ⇒ Object
-
#initialize(source, options = {}) ⇒ SessionWrapper
constructor
A new instance of SessionWrapper.
- #reload ⇒ Object
- #system_properties ⇒ Object
- #system_update(*args, &block) ⇒ Object
- #update(*args, &block) ⇒ Object
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 = || {} @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 |
#clear ⇒ Object
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 |
#reload ⇒ Object
31 32 33 |
# File 'lib/tengine/core/session_wrapper.rb', line 31 def reload @source.reload end |
#system_properties ⇒ Object
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 |