Class: Lore::Cache::File_Index
- Inherits:
-
Model
- Object
- Table_Accessor
- Model
- Lore::Cache::File_Index
- Defined in:
- lib/lore/cache/file_index.rb
Class Method Summary collapse
- .delete_entry(table_name) ⇒ Object
-
.for(table_name) ⇒ Object
Return array of cache file names depending from model.
Methods inherited from Model
Methods included from Cacheable
#create_entity_cache, #entity_cache, #flush_entity_cache, #read_entity_cache, #use_entity_cache
Methods included from Query_Shortcuts
#all, #all_with, #delete, #delete_all, #each, #find, #set, #value_of
Methods included from Aspect
#after_commit, #after_instance_delete, #before_commit, #before_instance_delete
Methods inherited from Table_Accessor
[], __associations__, __attributes__, __delete_strategy__, __filters__, __insert_strategy__, __select_strategy__, __update_strategy__, all_table_names, #attribute_values_by_table, create, delete, disable_output_filters, distribute_attrib_values, enable_output_filters, explicit_insert, get, get_fields, get_fields_flat, get_own_primary_keys, get_primary_keys, get_sequences, #initialize, insert, inspect, is_a?, key_array, load, #log, log, method_missing, new_polymorphic, org_is_a?, output_filters_disabled?, polymorphic_select, polymorphic_select_query, polymorphic_select_value, polymorphic_select_values, select, select_query, select_value, select_values, set_sequences, table_name, update
Methods included from Prepare
Methods included from Model_Shortcuts
Methods included from Polymorphic_Class_Methods
#is_polymorphic, #is_polymorphic?, #polymorphic_attribute, #polymorphic_attribute_index, #select_polymorphic
Methods included from Prepare_Class_Methods
#by_id, #execute_prepared, #prepare
Methods included from Polymorphic_Instance_Methods
Methods included from Model_Instance
#<=>, #==, #===, #[], #abs_attr, #attr, #attribute_values, #commit, #delete, #get_attribute_value_map, #get_attribute_values, #get_label_string, #get_primary_key_value_map, #get_primary_key_values, #id, #inspect, #is_cached_entity?, #key, #marshal_dump, #marshal_load, #method_missing, #obj_id, #pkey, #pkeys, #set_attribute_value, #set_attribute_values, #table_accessor, #touch, #touched?, #untouch, #update_pkey_values, #update_values
Constructor Details
This class inherits a constructor from Lore::Table_Accessor
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Lore::Model_Instance
Class Method Details
.delete_entry(table_name) ⇒ Object
24 25 26 27 28 |
# File 'lib/lore/cache/file_index.rb', line 24 def self.delete_entry(table_name) delete { |i| i.where(i.model == table_name) } end |
.for(table_name) ⇒ Object
Return array of cache file names depending from model
16 17 18 19 20 21 22 |
# File 'lib/lore/cache/file_index.rb', line 16 def self.for(table_name) select { |i| i.where(i.model == table_name) }.collect { |index| index.file } end |