Class: Pumi::StoreCache
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Pumi::StoreCache
- Defined in:
- lib/pumi/store_cache.rb
Instance Attribute Summary collapse
-
#cached ⇒ Object
readonly
Returns the value of attribute cached.
Instance Method Summary collapse
-
#initialize(data_store) ⇒ StoreCache
constructor
A new instance of StoreCache.
- #load(type, *args) ⇒ Object
Constructor Details
#initialize(data_store) ⇒ StoreCache
Returns a new instance of StoreCache.
7 8 9 10 11 |
# File 'lib/pumi/store_cache.rb', line 7 def initialize(data_store) super(data_store) @cached = {} end |
Instance Attribute Details
#cached ⇒ Object (readonly)
Returns the value of attribute cached.
5 6 7 |
# File 'lib/pumi/store_cache.rb', line 5 def cached @cached end |
Instance Method Details
#load(type, *args) ⇒ Object
13 14 15 16 17 |
# File 'lib/pumi/store_cache.rb', line 13 def load(type, *args) cached.fetch(type) do cached[type] = super end end |