Class: LaunchDarkly::ThreadSafeMemoryStore
- Inherits:
-
Object
- Object
- LaunchDarkly::ThreadSafeMemoryStore
- Defined in:
- lib/ldclient-rb/store.rb
Instance Method Summary collapse
-
#initialize ⇒ ThreadSafeMemoryStore
constructor
A new instance of ThreadSafeMemoryStore.
- #read(key) ⇒ Object
- #write(key, value) ⇒ Object
Constructor Details
#initialize ⇒ ThreadSafeMemoryStore
Returns a new instance of ThreadSafeMemoryStore.
5 6 7 |
# File 'lib/ldclient-rb/store.rb', line 5 def initialize @cache = ThreadSafe::Cache.new end |
Instance Method Details
#read(key) ⇒ Object
9 10 11 |
# File 'lib/ldclient-rb/store.rb', line 9 def read(key) @cache[key] end |
#write(key, value) ⇒ Object
13 14 15 |
# File 'lib/ldclient-rb/store.rb', line 13 def write(key, value) @cache[key] = value end |