Class: ShopifyCLI::Theme::Syncer::Uploader::Forms::ApplyToAllForm

Inherits:
Form
  • Object
show all
Defined in:
lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb

Instance Attribute Summary collapse

Attributes inherited from Form

#ctx, #xargs

Instance Method Summary collapse

Methods inherited from Form

ask, flag_arguments, #initialize, positional_arguments

Constructor Details

This class inherits a constructor from ShopifyCLI::Form

Instance Attribute Details

#applyObject

Returns the value of attribute apply.



9
10
11
# File 'lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb', line 9

def apply
  @apply
end

Instance Method Details

#apply?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb', line 23

def apply?
  apply
end

#askObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb', line 12

def ask
  title = message("title", number_of_files - 1)

  self.apply = CLI::UI::Prompt.ask(title, allow_empty: false) do |handler|
    handler.option(message("yes")) { true }
    handler.option(message("no")) { false }
  end

  self
end