Class: Extension::Tasks::ConfigureFeatures

Inherits:
Object
  • Object
show all
Includes:
ShopifyCLI::MethodObject
Defined in:
lib/project_types/extension/tasks/configure_features.rb

Defined Under Namespace

Classes: Error, UnknownSurfaceArea, UnspecifiedSurfaceArea

Instance Method Summary collapse

Methods included from ShopifyCLI::MethodObject

included, #to_proc

Instance Method Details

#call(specification_attribute_sets) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/project_types/extension/tasks/configure_features.rb', line 10

def call(specification_attribute_sets)
  specification_attribute_sets.each do |attributes|
    argo_configuration = extract_argo_configuration(attributes)
    next if argo_configuration.nil?
    surface_area = extract_surface_area(argo_configuration)
    if known_surface_area?(surface_area)
      surface_area_configuration = fetch_surface_area_configuration(surface_area)
      argo_configuration.merge!(surface_area_configuration)
    else
      clear_argo_configuration(attributes)
    end
  end
end