Class: SandthornSnapshotMemcached::SnapshotStore
- Inherits:
-
Object
- Object
- SandthornSnapshotMemcached::SnapshotStore
- Defined in:
- lib/sandthorn_snapshot_memcached/snapshot_store.rb
Instance Method Summary collapse
- #find(aggregate_id) ⇒ Object
-
#initialize(url) ⇒ SnapshotStore
constructor
A new instance of SnapshotStore.
- #save(aggregate_id, aggregate) ⇒ Object
Constructor Details
#initialize(url) ⇒ SnapshotStore
Returns a new instance of SnapshotStore.
5 6 7 8 |
# File 'lib/sandthorn_snapshot_memcached/snapshot_store.rb', line 5 def initialize url = { :compress => true } @store = Dalli::Client.new(url, ) end |
Instance Method Details
#find(aggregate_id) ⇒ Object
14 15 16 |
# File 'lib/sandthorn_snapshot_memcached/snapshot_store.rb', line 14 def find aggregate_id @store.get(aggregate_id) end |
#save(aggregate_id, aggregate) ⇒ Object
10 11 12 |
# File 'lib/sandthorn_snapshot_memcached/snapshot_store.rb', line 10 def save aggregate_id, aggregate @store.set(aggregate_id, aggregate) end |