Sha256: 449bd5f0176ae962c352227b2d5f4d9817ae97099671944865c6de849bd27599

Contents?: true

Size: 372 Bytes

Versions: 16

Compression:

Stored size: 372 Bytes

Contents

module CLIUtils
  # A Validator to verify whether a Pref answer
  # is not empty or nil.
  class NonNilValidator < PrefValidator
    # Runs the Validator against the answer.
    # @param [Object] text The "text" to evaluate
    # @return [String]
    def validate(text)
      @is_valid = !text.nil? && !text.empty?
      @message = 'Nil text not allowed'
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
cliutils-2.2.6 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.2.5 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.2.4 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.2.3 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.2.2 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.2.1 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.2.0 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.1.4 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.1.3 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.1.2 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.1.1 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.1.0 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.0.3 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.0.2 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.0.1 lib/cliutils/prefs/pref_validators/non_nil_validator.rb
cliutils-2.0.0 lib/cliutils/prefs/pref_validators/non_nil_validator.rb