Class: TTY::Prompt::Question::Checks::CheckDefault

Inherits:
Object
  • Object
show all
Defined in:
lib/tty/prompt/question/checks.rb

Overview

Check if default value provided

Class Method Summary collapse

Class Method Details

.call(question, value) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/tty/prompt/question/checks.rb', line 67

def self.call(question, value)
  if value.nil? && question.default?
    [question.default]
  else
    [value]
  end
end