Class: ShopifyCLI::Theme::Syncer::Uploader::Forms::ApplyToAll

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ctx, number_of_files) ⇒ ApplyToAll

Returns a new instance of ApplyToAll.



13
14
15
16
17
18
# File 'lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all.rb', line 13

def initialize(ctx, number_of_files)
  @ctx = ctx
  @number_of_files = number_of_files
  @value = nil
  @apply = nil
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11
12
13
# File 'lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all.rb', line 11

def value
  @value
end

Instance Method Details

#apply?(value) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
23
24
25
26
27
28
29
# File 'lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all.rb', line 20

def apply?(value)
  return unless @number_of_files > 1

  if @apply.nil?
    @apply = ask.apply?
    @value = value if @apply
  end

  @apply
end