Class: EacCli::RunnerWith::Confirmation::InputResult
- Defined in:
- lib/eac_cli/runner_with/confirmation/input_result.rb
Constant Summary collapse
- INPUT_NO_FOR_ONE =
'n'
- INPUT_NO_FOR_ALL =
'N'
- INPUT_YES_FOR_ONE =
'y'
- INPUT_YES_FOR_ALL =
'Y'
- INPUT_FOR_ONE =
[INPUT_NO_FOR_ONE, INPUT_YES_FOR_ONE].freeze
- INPUT_FOR_ALL =
[INPUT_NO_FOR_ALL, INPUT_YES_FOR_ALL].freeze
- INPUT_NO =
[INPUT_NO_FOR_ONE, INPUT_NO_FOR_ALL].freeze
- INPUT_YES =
[INPUT_YES_FOR_ONE, INPUT_YES_FOR_ALL].freeze
- INPUT_LIST =
[INPUT_NO_FOR_ALL, INPUT_NO_FOR_ONE, INPUT_YES_FOR_ONE, INPUT_YES_FOR_ALL] .freeze
Class Method Summary collapse
- .by_message(message) ⇒ EacCli::RunnerWith::Confirmation::InputResult
- .input_value_by_speaker(message) ⇒ String
Instance Method Summary collapse
Class Method Details
.by_message(message) ⇒ EacCli::RunnerWith::Confirmation::InputResult
25 26 27 |
# File 'lib/eac_cli/runner_with/confirmation/input_result.rb', line 25 def () new(input_value_by_speaker()) end |
.input_value_by_speaker(message) ⇒ String
31 32 33 |
# File 'lib/eac_cli/runner_with/confirmation/input_result.rb', line 31 def input_value_by_speaker() input(, list: INPUT_LIST, ignore_case: false) end |
Instance Method Details
#confirm? ⇒ Boolean
39 40 41 |
# File 'lib/eac_cli/runner_with/confirmation/input_result.rb', line 39 def confirm? input_value_to_bool(INPUT_NO, INPUT_YES) end |
#for_all? ⇒ Boolean
44 45 46 |
# File 'lib/eac_cli/runner_with/confirmation/input_result.rb', line 44 def for_all? input_value_to_bool(INPUT_FOR_ONE, INPUT_FOR_ALL) end |