Class: EntityCache::Controls::Storage::Persistent::Example
- Inherits:
-
Object
- Object
- EntityCache::Controls::Storage::Persistent::Example
show all
- Includes:
- Storage::Persistent
- Defined in:
- lib/entity_cache/controls/storage/persistent.rb
Defined Under Namespace
Modules: Assertions
Constant Summary
Storage::Persistent::Error
Instance Attribute Summary
#subject
Instance Method Summary
collapse
included, #initialize
Instance Method Details
#get(id) ⇒ Object
8
9
10
11
12
|
# File 'lib/entity_cache/controls/storage/persistent.rb', line 8
def get(id)
entity, version, time = records[id]
return entity, version, time
end
|
#put(id, entity, version, time) ⇒ Object
14
15
16
|
# File 'lib/entity_cache/controls/storage/persistent.rb', line 14
def put(id, entity, version, time)
records[id] = [entity, version, time]
end
|
#records ⇒ Object
18
19
20
|
# File 'lib/entity_cache/controls/storage/persistent.rb', line 18
def records
@records ||= {}
end
|