Class: Theme::Forms::Select
- Inherits:
-
ShopifyCLI::Form
- Object
- ShopifyCLI::Form
- Theme::Forms::Select
- Defined in:
- lib/project_types/theme/forms/select.rb
Instance Attribute Summary collapse
-
#theme ⇒ Object
Returns the value of attribute theme.
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
#theme ⇒ Object
Returns the value of attribute theme.
8 9 10 |
# File 'lib/project_types/theme/forms/select.rb', line 8 def theme @theme end |
Instance Method Details
#ask ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/project_types/theme/forms/select.rb', line 11 def ask self.theme = CLI::UI::Prompt.ask(title, allow_empty: false) do |handler| theme_presenters.each do |presenter| theme = presenter.theme next if exclude_roles&.include?(theme.role) next if !include_foreign_developments && theme.foreign_development? handler.option(presenter.to_s(:short)) { theme } end if handler..empty? && cmd @ctx.abort(@ctx.("theme.#{cmd}.no_themes_error"), @ctx.("theme.#{cmd}.no_themes_resolution")) end end end |