Class: Split::Persistence::SessionAdapter
- Inherits:
-
Object
- Object
- Split::Persistence::SessionAdapter
- Defined in:
- lib/split/persistence/session_adapter.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #delete(key) ⇒ Object
-
#initialize(context) ⇒ SessionAdapter
constructor
A new instance of SessionAdapter.
- #keys ⇒ Object
Constructor Details
#initialize(context) ⇒ SessionAdapter
Returns a new instance of SessionAdapter.
7 8 9 10 |
# File 'lib/split/persistence/session_adapter.rb', line 7 def initialize(context) @session = context.session @session[:split] ||= {} end |
Instance Method Details
#[](key) ⇒ Object
12 13 14 |
# File 'lib/split/persistence/session_adapter.rb', line 12 def [](key) @session[:split][key] end |
#[]=(key, value) ⇒ Object
16 17 18 |
# File 'lib/split/persistence/session_adapter.rb', line 16 def []=(key, value) @session[:split][key] = value end |
#delete(key) ⇒ Object
20 21 22 |
# File 'lib/split/persistence/session_adapter.rb', line 20 def delete(key) @session[:split].delete(key) end |
#keys ⇒ Object
24 25 26 |
# File 'lib/split/persistence/session_adapter.rb', line 24 def keys @session[:split].keys end |