Class: Extension::Forms::Connect
- Inherits:
-
ShopifyCLI::Form
- Object
- ShopifyCLI::Form
- Extension::Forms::Connect
- Defined in:
- lib/project_types/extension/forms/connect.rb
Defined Under Namespace
Classes: ExtensionProjectDetails
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#registration ⇒ Object
readonly
Returns the value of attribute registration.
Attributes inherited from ShopifyCLI::Form
Instance Method Summary collapse
Methods inherited from ShopifyCLI::Form
ask, flag_arguments, #initialize, positional_arguments
Constructor Details
This class inherits a constructor from ShopifyCLI::Form
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
6 7 8 |
# File 'lib/project_types/extension/forms/connect.rb', line 6 def app @app end |
#registration ⇒ Object
Returns the value of attribute registration.
6 7 8 |
# File 'lib/project_types/extension/forms/connect.rb', line 6 def registration @registration end |
Instance Method Details
#ask ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/project_types/extension/forms/connect.rb', line 21 def ask ShopifyCLI::Result.wrap(ExtensionProjectDetails.new) .then(&Questions::AskRegistration.new(ctx: ctx, type: type)) .unwrap { |e| raise e } .tap do |project_details| ctx.abort(ctx.("connect.incomplete_configuration")) unless project_details.complete? self.registration = project_details.registration self.app = project_details.app end end |
#directory_name ⇒ Object
33 34 35 |
# File 'lib/project_types/extension/forms/connect.rb', line 33 def directory_name name.strip.gsub(/( )/, "_").downcase end |