Class: Notion::OAuth::MemoryTokenStore
- Inherits:
-
TokenStore
- Object
- TokenStore
- Notion::OAuth::MemoryTokenStore
- Defined in:
- lib/notion/oauth.rb
Instance Method Summary collapse
-
#initialize ⇒ MemoryTokenStore
constructor
A new instance of MemoryTokenStore.
- #read(key) ⇒ Object
- #write(key, token) ⇒ Object
Constructor Details
#initialize ⇒ MemoryTokenStore
Returns a new instance of MemoryTokenStore.
81 82 83 84 85 |
# File 'lib/notion/oauth.rb', line 81 def initialize super @tokens = {} @mutex = Mutex.new end |
Instance Method Details
#read(key) ⇒ Object
87 |
# File 'lib/notion/oauth.rb', line 87 def read(key) = @mutex.synchronize { @tokens[key] } |
#write(key, token) ⇒ Object
88 |
# File 'lib/notion/oauth.rb', line 88 def write(key, token) = @mutex.synchronize { @tokens[key] = token } |