Class: CalendarAssistant::Config::TokenStore
- Inherits:
-
Object
- Object
- CalendarAssistant::Config::TokenStore
- Defined in:
- lib/calendar_assistant/config/token_store.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #delete(id) ⇒ Object
-
#initialize(config) ⇒ TokenStore
constructor
A new instance of TokenStore.
- #load(id) ⇒ Object
- #store(id, token) ⇒ Object
Constructor Details
#initialize(config) ⇒ TokenStore
Returns a new instance of TokenStore.
6 7 8 |
# File 'lib/calendar_assistant/config/token_store.rb', line 6 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/calendar_assistant/config/token_store.rb', line 4 def config @config end |
Instance Method Details
#delete(id) ⇒ Object
10 11 12 13 |
# File 'lib/calendar_assistant/config/token_store.rb', line 10 def delete(id) config.tokens.delete(id) config.persist! end |
#load(id) ⇒ Object
15 16 17 |
# File 'lib/calendar_assistant/config/token_store.rb', line 15 def load(id) config.tokens[id] end |
#store(id, token) ⇒ Object
19 20 21 22 |
# File 'lib/calendar_assistant/config/token_store.rb', line 19 def store(id, token) config.tokens[id] = token config.persist! end |