class DTK::Client::Operation::Module::Install::DependentModules::PromptHelper

Constants

PROMPT_OPTIONS

Attributes

update_all[R]
update_none[R]

Public Class Methods

new(opts = {}) click to toggle source

opts can have keys

:update_all
:update_none
# File lib/client/operation/module/install/dependent_modules/prompt_helper.rb, line 25
def initialize(opts = {})
  @update_all  = opts[:update_all]
  @update_none = opts[:update_none]
end

Public Instance Methods

pull_module_update?(print_helper) click to toggle source
# File lib/client/operation/module/install/dependent_modules/prompt_helper.rb, line 31
def pull_module_update?(print_helper)
  return false if @update_none
  return true if @update_all

  update = Console.confirmation_prompt_additional_options(print_helper.dependent_module_update_prompt, PROMPT_OPTIONS)
  return false unless update
  
  if update.eql?('all')
    @update_all = true
    true
  elsif update.eql?('none')
    @update_none = true
    false
  else
    # means update this one
    true
  end
end