Class: ShopifyCLI::Services::App::Create::PHPService
- Inherits:
-
BaseService
- Object
- BaseService
- ShopifyCLI::Services::App::Create::PHPService
- Defined in:
- lib/shopify_cli/services/app/create/php_service.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
-
#store_domain ⇒ Object
readonly
Returns the value of attribute store_domain.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name:, organization_id:, store_domain:, type:, verbose:, context:) ⇒ PHPService
constructor
A new instance of PHPService.
Methods inherited from BaseService
Constructor Details
#initialize(name:, organization_id:, store_domain:, type:, verbose:, context:) ⇒ PHPService
Returns a new instance of PHPService.
10 11 12 13 14 15 16 17 18 |
# File 'lib/shopify_cli/services/app/create/php_service.rb', line 10 def initialize(name:, organization_id:, store_domain:, type:, verbose:, context:) @name = name @organization_id = organization_id @store_domain = store_domain @type = type @verbose = verbose @context = context super() end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
8 9 10 |
# File 'lib/shopify_cli/services/app/create/php_service.rb', line 8 def context @context end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/shopify_cli/services/app/create/php_service.rb', line 8 def name @name end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
8 9 10 |
# File 'lib/shopify_cli/services/app/create/php_service.rb', line 8 def organization_id @organization_id end |
#store_domain ⇒ Object (readonly)
Returns the value of attribute store_domain.
8 9 10 |
# File 'lib/shopify_cli/services/app/create/php_service.rb', line 8 def store_domain @store_domain end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/shopify_cli/services/app/create/php_service.rb', line 8 def type @type end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
8 9 10 |
# File 'lib/shopify_cli/services/app/create/php_service.rb', line 8 def verbose @verbose end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/shopify_cli/services/app/create/php_service.rb', line 20 def call form = PHP::Forms::Create.ask(context, [], { name: name, organization_id: organization_id, shop_domain: store_domain, type: type, verbose: verbose, }) raise ShopifyCLI::AbortSilent if form.nil? check_php check_composer check_npm app_id = build(form) ShopifyCLI::Project.write( context, project_type: "php", organization_id: form.organization_id, ) partners_url = ShopifyCLI::PartnersAPI.partners_url_for(form.organization_id, app_id) context.puts(context.("apps.create.info.created", form.name, partners_url)) context.puts(context.("apps.create.info.serve", form.name, ShopifyCLI::TOOL_NAME)) unless ShopifyCLI::Shopifolk.acting_as_shopify_organization? context.puts(context.("apps.create.info.install", partners_url, form.name)) end end |