lib/codeowner_validator/helpers/config_helper.rb
# Public: An abstraction onto the TTY:Prompt.select to allow requesting information from the user's input
# and saving that input within the base module's configuration
#
# @param [Hash] args The arguments in which to accept
# @option args [String] :ident The identifier to the config to store
# @option args [String] :prompt The prompt to display to the user
# @option args [Boolean] :force_ask Indicates to ignore previous ask and perform again
# @option args [Boolean] :choices The array of choices available for selection by the user
An abstraction onto the TTY:Prompt.select to allow requesting information from the user's input
and saving that input within the base module's configuration
An abstraction onto the TTY : Prompt . select to allow requesting information from the user ' s input and saving that input within the base module ' s configuration
def select(ident:, prompt:, force_ask: false, choices:, **args)
        return if !force_ask && ::CodeownerValidator.respond_to?(ident)
        tty_prompt = ::TTY::Prompt.new
        response = tty_prompt.select(
          prompt,
          choices,
          args
        )
        ::CodeownerValidator.configure! ident => response
      end
def select ( ident : , prompt : , force_ask : false , choices : , ** args ) return if ! force_ask && :: CodeownerValidator . respond_to? ( ident ) tty_prompt = :: TTY :: Prompt . new response = tty_prompt . select ( prompt , choices , args ) :: CodeownerValidator . configure! ident => response end
Public: An abstraction onto the TTY:Prompt.select to allow requesting information from the user's input
and saving that input within the base module's configuration
Public : An abstraction onto the TTY : Prompt . select to allow requesting information from the user ' s input and saving that input within the base module ' s configuration
# return if either not being forced to ask or the information has been previously captured
ident
prompt
force_ask
choices
args
:choices The array of choices available for selection by the user
: choices The array of choices available for selection by the user
args The arguments in which to accept
args The arguments in which to accept