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.
6 7 8 9 |
# File 'lib/split/persistence/session_adapter.rb', line 6 def initialize(context) @session = context.session @session[:split] ||= {} end |
Instance Method Details
#[](key) ⇒ Object
11 12 13 |
# File 'lib/split/persistence/session_adapter.rb', line 11 def [](key) @session[:split][key] end |
#[]=(key, value) ⇒ Object
15 16 17 |
# File 'lib/split/persistence/session_adapter.rb', line 15 def []=(key, value) @session[:split][key] = value end |
#delete(key) ⇒ Object
19 20 21 |
# File 'lib/split/persistence/session_adapter.rb', line 19 def delete(key) @session[:split].delete(key) end |
#keys ⇒ Object
23 24 25 |
# File 'lib/split/persistence/session_adapter.rb', line 23 def keys @session[:split].keys end |