Class: Core::Local::Store
- Inherits:
-
Object
- Object
- Core::Local::Store
- Extended by:
- Forwardable
- Includes:
- Global
- Defined in:
- lib/core/local/store.rb
Overview
- public
-
Simple key/value store, localized to a thread or fiber.
Instance Method Summary collapse
-
#cleanup(key) ⇒ Object
- public
-
Returns a proc that, when called, deletes the key from the global store.
-
#initialize ⇒ Store
constructor
A new instance of Store.
Constructor Details
#initialize ⇒ Store
Returns a new instance of Store.
15 16 17 |
# File 'lib/core/local/store.rb', line 15 def initialize @key = :"__corerb_localized_state_#{object_id}__" end |
Instance Method Details
#cleanup(key) ⇒ Object
- public
-
Returns a proc that, when called, deletes the key from the global store.
21 22 23 |
# File 'lib/core/local/store.rb', line 21 def cleanup(key) proc { delete(key) } end |