Class: EntityCache::Store::Internal::Substitute::Internal
Instance Attribute Summary
#subject
Instance Method Summary
collapse
#records
build, configure, #count, #delete, #empty?, #get, #put
Instance Method Details
#add(id, entity, version, time, persisted_version: nil, persisted_time: nil) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/entity_cache/store/internal/substitute.rb', line 10
def add(id, entity, version, time, persisted_version: nil, persisted_time: nil)
record = Record.build(
id,
entity,
version,
time,
persisted_version: persisted_version,
persisted_time: persisted_time
)
put(record)
end
|
#put?(record = nil) ⇒ Boolean
23
24
25
26
27
28
29
30
31
|
# File 'lib/entity_cache/store/internal/substitute.rb', line 23
def put?(record=nil)
if record.nil?
records.any?
else
records.any? do |_, r|
r == record
end
end
end
|