Module: Persistence::Object::IndexHash

Defined in:
lib/persistence/object/index_hash.rb

Overview

Internal helper module with common features for hashes that store indexes.

Instance Method Summary collapse

Instance Method Details

#child_pre_set_hook(index_name, index_instance) ⇒ Object

child_pre_set_hook #


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/persistence/object/index_hash.rb', line 23

def child_pre_set_hook( index_name, index_instance )
  
  parent_bucket = nil
  
  case configuration_instance
    when ::Module
      parent_bucket = configuration_instance.instance_persistence_bucket
    else
      parent_bucket = configuration_instance.persistence_bucket
  end
  
  child_index_instance = index_instance.class.new( nil, parent_bucket, nil, nil, nil, index_instance )

  return child_index_instance
  
end

#post_set_hook(index_name, index_instance) ⇒ Object

post_set_hook #


13
14
15
16
17
# File 'lib/persistence/object/index_hash.rb', line 13

def post_set_hook( index_name, index_instance )

  configuration_instance.indexes[ index_name ] = index_instance
  
end