Class: Script::Layers::Application::EnableScript

Inherits:
Object
  • Object
show all
Defined in:
lib/project_types/script/layers/application/enable_script.rb

Class Method Summary collapse

Class Method Details

.call(ctx:, api_key:, shop_domain:, configuration:, extension_point_type:, title:) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/project_types/script/layers/application/enable_script.rb', line 7

def self.call(ctx:, api_key:, shop_domain:, configuration:, extension_point_type:, title:)
  UI::PrintingSpinner.spin(ctx, ctx.message('script.application.enabling')) do |p_ctx, spinner|
    script_service = Infrastructure::ScriptService.new(ctx: p_ctx)
    script_service.enable(
      api_key: api_key,
      shop_domain: shop_domain,
      configuration: configuration,
      extension_point_type: extension_point_type,
      title: title
    )
    spinner.update_title(p_ctx.message('script.application.enabled'))
  end
end