Class: DTK::Client::Operation::Module::Install::DependentModules::ComponentDependencyTree::Cache
- Inherits:
-
Hash
- Object
- Hash
- DTK::Client::Operation::Module::Install::DependentModules::ComponentDependencyTree::Cache
- Defined in:
- lib/client/operation/module/install/dependent_modules/component_dependency_tree/cache.rb
Instance Method Summary collapse
- #add!(module_ref, dependencies) ⇒ Object
- #all_modules_refs ⇒ Object
-
#initialize ⇒ Cache
constructor
hash where key unqiuely determines module_refs and value is to hash with keys :module_ref and :dependencies.
- #lookup_dependencies?(module_ref) ⇒ Boolean
Constructor Details
#initialize ⇒ Cache
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_refs ⇒ Object
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
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 |