Module: Cash::Index::Commands

Included in:
Cash::Index
Defined in:
lib/cash/index.rb

Instance Method Summary collapse

Instance Method Details

#add(object) ⇒ Object



25
26
27
28
# File 'lib/cash/index.rb', line 25

def add(object)
  _, new_attribute_value_pairs = old_and_new_attribute_value_pairs(object)
  add_to_index_with_minimal_network_operations(new_attribute_value_pairs, object)
end

#delete(object) ⇒ Object



40
41
42
43
44
# File 'lib/cash/index.rb', line 40

def delete(object)
  old_attribute_value_pairs, _ = old_and_new_attribute_value_pairs(object)
  key = cache_key(old_attribute_value_pairs)
  expire(key)
end

#remove(object) ⇒ Object



35
36
37
38
# File 'lib/cash/index.rb', line 35

def remove(object)
  old_attribute_value_pairs, _ = old_and_new_attribute_value_pairs(object)
  remove_from_index_with_minimal_network_operations(old_attribute_value_pairs, object)
end

#update(object) ⇒ Object



30
31
32
33
# File 'lib/cash/index.rb', line 30

def update(object)
  old_attribute_value_pairs, new_attribute_value_pairs = old_and_new_attribute_value_pairs(object)
  update_index_with_minimal_network_operations(old_attribute_value_pairs, new_attribute_value_pairs, object)
end