Class: TTY2::Prompt::Question::Checks::CheckRequired
- Inherits:
-
Object
- Object
- TTY2::Prompt::Question::Checks::CheckRequired
- Defined in:
- lib/tty2/prompt/question/checks.rb
Overview
Check if input is required
Class Method Summary collapse
Class Method Details
.call(question, value) ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/tty2/prompt/question/checks.rb', line 78 def self.call(question, value) if question.required? && !question.default? && value.nil? [value, question.(:required?)] else [value] end end |