Module: Persistence::Object::Complex::Index::AttributeIndex::AttributeIndexInterface

Includes:
CascadingConfiguration::Setting, Index
Included in:
Persistence::Object::Complex::Index::AttributeIndex
Defined in:
lib/persistence/object/complex/index/attribute_index/attribute_index_interface.rb

Overview

Interface for index on object attributes, which calls attribute method to retrieve value for persistence,

and which will load value from persistence port back into same attribute through setter method.

Instance Attribute Summary

Attributes included from Index

#parent_bucket

Instance Method Summary collapse

Methods included from Index

#adapter_index, #atomic_cursor, #count, #cursor, #delete_keys_for_object!, #delete_keys_for_object_id!, #disable, #each, #get_object_id, #index_existing_objects, #index_object_id, #init_sorting_procs, #initialize, #initialize_for_bucket, #name, #permits_duplicates?, #persisted?, #sorting_proc_for_sort_name

Instance Method Details

#attribute_nameSymbol, String

Returns Name of attribute index indexes.

Returns:

  • (Symbol, String)

    Name of attribute index indexes.



# File 'lib/persistence/object/complex/index/attribute_index/attribute_index_interface.rb', line 16

#attribute_name=(attribute_name) ⇒ Object

Parameters:

  • attribute_name

    Name of attribute to index



27
# File 'lib/persistence/object/complex/index/attribute_index/attribute_index_interface.rb', line 27

attr_setting :attribute_name

#index_object(object) ⇒ Object

index_object #



33
34
35
36
37
38
39
40
41
# File 'lib/persistence/object/complex/index/attribute_index/attribute_index_interface.rb', line 33

def index_object( object )

  # get attribute value
  attribute_value = object.__send__( attribute_name )

  # store in super - key/value index
  return super( object, attribute_value )
  
end