Class: Guard::Bosh::EffectivePropertiesCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/bosh/effective_properties_calculator.rb

Overview

The effective set of properties is the union of:

  • The default properties declared in the job spec

  • The properties declared at the top-level of the manifest

  • The properties declared at the job-level of the manifest

Instance Method Summary collapse

Constructor Details

#initialize(loaders:) ⇒ EffectivePropertiesCalculator

Returns a new instance of EffectivePropertiesCalculator.



10
11
12
# File 'lib/guard/bosh/effective_properties_calculator.rb', line 10

def initialize(loaders:)
  @loaders = loaders
end

Instance Method Details

#calculate_effective_properties(job) ⇒ Object



14
15
16
17
18
# File 'lib/guard/bosh/effective_properties_calculator.rb', line 14

def calculate_effective_properties(job)
  @loaders.inject({}) do |result, loader|
    result.deep_merge!(loader.load_properties(job))
  end
end