Class: EacLauncher::Context::InstanceManager::CachedInstances
- Inherits:
-
Object
- Object
- EacLauncher::Context::InstanceManager::CachedInstances
- Defined in:
- lib/eac_launcher/context/instance_manager.rb
Instance Method Summary collapse
- #by_logical_path(key) ⇒ Object
-
#initialize(content) ⇒ CachedInstances
constructor
A new instance of CachedInstances.
- #instances ⇒ Object
Constructor Details
#initialize(content) ⇒ CachedInstances
Returns a new instance of CachedInstances.
74 75 76 77 |
# File 'lib/eac_launcher/context/instance_manager.rb', line 74 def initialize(content) @content = content @instances = {} end |
Instance Method Details
#by_logical_path(key) ⇒ Object
83 84 85 86 87 88 89 90 |
# File 'lib/eac_launcher/context/instance_manager.rb', line 83 def by_logical_path(key) return @instances[key] if @instances.key?(key) h = @content[key] parent_instance = h[:parent] ? by_logical_path(h[:parent]) : nil path = ::EacLauncher::Paths::Logical.from_h(@context, h) @instances[key] = ::EacLauncher::Instances::Base.instanciate(path, parent_instance) end |
#instances ⇒ Object
79 80 81 |
# File 'lib/eac_launcher/context/instance_manager.rb', line 79 def instances @content.keys.map { |k| by_logical_path(k) } end |