Module: Origami::ObjectCache

Included in:
CompoundObject
Defined in:
lib/origami/compound.rb

Overview

Module for maintaining internal caches of objects for fast lookup.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#names_cacheObject (readonly)

Returns the value of attribute names_cache.



26
27
28
# File 'lib/origami/compound.rb', line 26

def names_cache
  @names_cache
end

#strings_cacheObject (readonly)

Returns the value of attribute strings_cache.



26
27
28
# File 'lib/origami/compound.rb', line 26

def strings_cache
  @strings_cache
end

#xref_cacheObject (readonly)

Returns the value of attribute xref_cache.



26
27
28
# File 'lib/origami/compound.rb', line 26

def xref_cache
  @xref_cache
end

Instance Method Details

#initialize(*args) ⇒ Object



28
29
30
31
32
# File 'lib/origami/compound.rb', line 28

def initialize(*args)
  super

  init_caches
end

#rebuild_cachesObject



34
35
36
37
38
39
40
41
# File 'lib/origami/compound.rb', line 34

def rebuild_caches
  each do |*items|
    items.each do |object|
      object.rebuild_caches if object.is_a?(CompoundObject)
      cache_object(object)
    end
  end
end