Class: Notion::OAuth::MemoryTokenStore

Inherits:
TokenStore
  • Object
show all
Defined in:
lib/notion/oauth.rb

Instance Method Summary collapse

Constructor Details

#initializeMemoryTokenStore

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 }