Module: DevSuite::Utils::Construct::Config::DependencyHandler

Included in:
Base
Defined in:
lib/dev_suite/utils/construct/config/dependency_handler.rb

Instance Method Summary collapse

Instance Method Details

#missing_dependenciesObject

Use a lazy initializer in the getter method



9
10
11
# File 'lib/dev_suite/utils/construct/config/dependency_handler.rb', line 9

def missing_dependencies
  @missing_dependencies ||= []
end

#remove_failed_dependency(attr_name, option_key, *missing_dependencies) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dev_suite/utils/construct/config/dependency_handler.rb', line 13

def remove_failed_dependency(attr_name, option_key, *missing_dependencies)
  track_missing_dependency(missing_dependencies)

  attribute = send(attr_name)
  original_attribute = send("original_#{attr_name}")

  if original_attribute.is_a?(Array) && original_attribute.include?(option_key)
    attribute.delete(option_key)
    log_missing_dependency(attr_name, option_key, missing_dependencies)
  end
end