Class: EntityCache::Controls::Store::Internal::Example

Inherits:
Store::Internal
  • Object
show all
Defined in:
lib/entity_cache/controls/store/internal.rb

Instance Method Summary collapse

Instance Method Details

#put?(id, record = nil) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/entity_cache/controls/store/internal.rb', line 14

def put?(id, record=nil)
  if record.nil?
    records.key?(id)
  else
    records[id] == record
  end
end

#recordsObject



10
11
12
# File 'lib/entity_cache/controls/store/internal.rb', line 10

def records
  @records ||= {}
end