Class: ShopifyCLI::Services::App::ConnectService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/shopify_cli/services/app/connect_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseService

call

Constructor Details

#initialize(app_type:, project:, context:) ⇒ ConnectService

Returns a new instance of ConnectService.



7
8
9
10
11
12
# File 'lib/shopify_cli/services/app/connect_service.rb', line 7

def initialize(app_type:, project:, context:)
  @app_type = app_type
  @project = project
  @context = context
  super()
end

Instance Attribute Details

#app_typeObject (readonly)

Returns the value of attribute app_type.



5
6
7
# File 'lib/shopify_cli/services/app/connect_service.rb', line 5

def app_type
  @app_type
end

#contextObject (readonly)

Returns the value of attribute context.



5
6
7
# File 'lib/shopify_cli/services/app/connect_service.rb', line 5

def context
  @context
end

#projectObject (readonly)

Returns the value of attribute project.



5
6
7
# File 'lib/shopify_cli/services/app/connect_service.rb', line 5

def project
  @project
end

Instance Method Details

#callObject



14
15
16
17
18
19
20
21
# File 'lib/shopify_cli/services/app/connect_service.rb', line 14

def call
  unless project&.env.nil?
    context.puts(context.message("core.app.connect.production_warning"))
  end

  app = ShopifyCLI::Connect.new(context).default_connect(app_type.to_s)
  context.done(context.message("core.app.connect.connected", app))
end