Class: DTK::Client::Operation::Module::Install::DependentModules::ComponentDependencyTree::Cache

Inherits:
Hash
  • Object
show all
Defined in:
lib/client/operation/module/install/dependent_modules/component_dependency_tree/cache.rb

Instance Method Summary collapse

Constructor Details

#initializeCache

hash where key unqiuely determines module_refs and value is to hash with keys :module_ref and :dependencies



22
23
24
# File 'lib/client/operation/module/install/dependent_modules/component_dependency_tree/cache.rb', line 22

def initialize
  super()
end

Instance Method Details

#add!(module_ref, dependencies) ⇒ Object



26
27
28
# File 'lib/client/operation/module/install/dependent_modules/component_dependency_tree/cache.rb', line 26

def add!(module_ref, dependencies)
  self[index(module_ref)] ||= {:module_ref => module_ref, :dependencies => dependencies }
end

#all_modules_refsObject



34
35
36
# File 'lib/client/operation/module/install/dependent_modules/component_dependency_tree/cache.rb', line 34

def all_modules_refs
  values.map { |hash| hash[:module_ref] }
end

#lookup_dependencies?(module_ref) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/client/operation/module/install/dependent_modules/component_dependency_tree/cache.rb', line 30

def lookup_dependencies?(module_ref)
  (self[index(module_ref)] || {})[:dependencies]
end