Class: TrailGuide::Adapters::Participants::Session::Adapter
- Inherits:
-
Object
- Object
- TrailGuide::Adapters::Participants::Session::Adapter
- Defined in:
- lib/trail_guide/adapters/participants/session.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #delete(key) ⇒ Object
- #destroy! ⇒ Object
-
#initialize(context, config) ⇒ Adapter
constructor
A new instance of Adapter.
- #key?(key) ⇒ Boolean
- #keys ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(context, config) ⇒ Adapter
Returns a new instance of Adapter.
31 32 33 34 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 31 def initialize(context, config) @context = context @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
29 30 31 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 29 def config @config end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
29 30 31 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 29 def context @context end |
Instance Method Details
#[](key) ⇒ Object
36 37 38 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 36 def [](key) session[key] end |
#[]=(key, value) ⇒ Object
40 41 42 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 40 def []=(key, value) session[key] = value end |
#delete(key) ⇒ Object
44 45 46 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 44 def delete(key) session.delete(key) end |
#destroy! ⇒ Object
48 49 50 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 48 def destroy! context.send(:session).delete(config.key) end |
#key?(key) ⇒ Boolean
56 57 58 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 56 def key?(key) session.key?(key) end |
#keys ⇒ Object
52 53 54 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 52 def keys session.keys end |
#to_h ⇒ Object
60 61 62 |
# File 'lib/trail_guide/adapters/participants/session.rb', line 60 def to_h session.to_h end |