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
55
# File 'lib/cash/write_through.rb', line 52

def add_to_caches(object)
  indices.each { |index| index.add(object) } if cacheable?
  true
end

#expire_caches(object) ⇒ Object



67
68
69
70
# File 'lib/cash/write_through.rb', line 67

def expire_caches(object)
  indices.each { |index| index.delete(object) } if cacheable?
  true
end

#remove_from_caches(object) ⇒ Object



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

def remove_from_caches(object)
  indices.each { |index| index.remove(object) } if cacheable?
  true
end

#update_caches(object) ⇒ Object



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

def update_caches(object)
  indices.each { |index| index.update(object) } if cacheable?
  true
end