Class: MangoApi::MemoryStorage
- Inherits:
-
Object
- Object
- MangoApi::MemoryStorage
- Defined in:
- lib/mangopay/api/auth_token_manager.rb
Overview
Stores client-specific OAuth tokens in-memory.
Instance Method Summary collapse
-
#initialize ⇒ MemoryStorage
constructor
A new instance of MemoryStorage.
-
#retrieve_for(client_id) ⇒ Object
Retrieves a client-specific OAuth token.
-
#store_for(client_id, token) ⇒ Object
Stores a client-specific OAuth token.
Constructor Details
#initialize ⇒ MemoryStorage
Returns a new instance of MemoryStorage.
98 99 100 |
# File 'lib/mangopay/api/auth_token_manager.rb', line 98 def initialize @token = {} end |
Instance Method Details
#retrieve_for(client_id) ⇒ Object
Retrieves a client-specific OAuth token.
105 106 107 |
# File 'lib/mangopay/api/auth_token_manager.rb', line 105 def retrieve_for(client_id) @token[client_id] end |
#store_for(client_id, token) ⇒ Object
Stores a client-specific OAuth token.
113 114 115 |
# File 'lib/mangopay/api/auth_token_manager.rb', line 113 def store_for(client_id, token) @token[client_id] = token end |