Module: Cash::WriteThrough::ClassMethods

Defined in:
lib/cash/write_through.rb

Instance Method Summary collapse

Instance Method Details

#add_to_caches(object) ⇒ Object



52
53
54
# File 'lib/cash/write_through.rb', line 52

def add_to_caches(object)
  indices.each { |index| index.add(object) } if cache_config
end

#expire_caches(object) ⇒ Object



64
65
66
# File 'lib/cash/write_through.rb', line 64

def expire_caches(object)
  indices.each { |index| index.delete(object) } if cache_config
end

#remove_from_caches(object) ⇒ Object



60
61
62
# File 'lib/cash/write_through.rb', line 60

def remove_from_caches(object)
  indices.each { |index| index.remove(object) } if cache_config
end

#update_caches(object) ⇒ Object



56
57
58
# File 'lib/cash/write_through.rb', line 56

def update_caches(object)
  indices.each { |index| index.update(object) } if cache_config
end