Class: TrailGuide::Adapters::Participants::Cookie::Adapter
- Inherits:
-
Object
- Object
- TrailGuide::Adapters::Participants::Cookie::Adapter
- Defined in:
- lib/trail_guide/adapters/participants/cookie.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.
36 37 38 39 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 36 def initialize(context, config) @context = context @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
34 35 36 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 34 def config @config end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
34 35 36 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 34 def context @context end |
Instance Method Details
#[](key) ⇒ Object
41 42 43 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 41 def [](key) [key.to_s] end |
#[]=(key, value) ⇒ Object
45 46 47 48 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 45 def []=(key, value) .merge!({key.to_s => value}) end |
#delete(key) ⇒ Object
50 51 52 53 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 50 def delete(key) .tap { |h| h.delete(key.to_s) } end |
#destroy! ⇒ Object
55 56 57 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 55 def destroy! .delete(config..to_s) end |
#key?(key) ⇒ Boolean
63 64 65 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 63 def key?(key) .key?(key) end |
#keys ⇒ Object
59 60 61 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 59 def keys .keys end |
#to_h ⇒ Object
67 68 69 |
# File 'lib/trail_guide/adapters/participants/cookie.rb', line 67 def to_h .to_h end |