Module: Cash::Index::Commands

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

Instance Method Summary collapse

Instance Method Details

#add(object) ⇒ Object



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

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



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

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



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

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



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

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