Class: PansophyAuthenticator::CacheStores::Memory
- Inherits:
-
Object
- Object
- PansophyAuthenticator::CacheStores::Memory
- Defined in:
- lib/pansophy_authenticator/cache_stores/memory.rb
Instance Method Summary collapse
- #delete(key) ⇒ Object
- #exist?(key) ⇒ Boolean
-
#initialize ⇒ Memory
constructor
A new instance of Memory.
- #read(key) ⇒ Object
- #write(key, value) ⇒ Object
Constructor Details
#initialize ⇒ Memory
Returns a new instance of Memory.
4 5 6 |
# File 'lib/pansophy_authenticator/cache_stores/memory.rb', line 4 def initialize @hash = {} end |
Instance Method Details
#delete(key) ⇒ Object
16 17 18 |
# File 'lib/pansophy_authenticator/cache_stores/memory.rb', line 16 def delete(key) @hash.delete(key.to_s) end |
#exist?(key) ⇒ Boolean
20 21 22 |
# File 'lib/pansophy_authenticator/cache_stores/memory.rb', line 20 def exist?(key) @hash.key?(key.to_s) end |
#read(key) ⇒ Object
8 9 10 |
# File 'lib/pansophy_authenticator/cache_stores/memory.rb', line 8 def read(key) @hash[key.to_s] end |
#write(key, value) ⇒ Object
12 13 14 |
# File 'lib/pansophy_authenticator/cache_stores/memory.rb', line 12 def write(key, value) @hash[key.to_s] = value end |