Sha256: 8f9ce77ade6c69f59b70d8dea1daa1a0cab6dcb62afdcc52744644bb0b60573e

Contents?: true

Size: 648 Bytes

Versions: 12

Compression:

Stored size: 648 Bytes

Contents

module CLIUtils
  # The generic base class for a Pref
  # Validator.
  class PrefValidator
    include Messaging

    # Holds whether the validator returned
    # successful or not.
    # @return [Boolean]
    attr_accessor :is_valid

    # Holds the message to display to the
    # user when the Validator fails.
    # @return [String]
    attr_accessor :message

    # Validate the Validator!
    # @param [String] text
    # @raise [StandardError] if the subclass
    #   doesn't implement this method.
    # @return [void]
    def validate(text = nil)
      fail "`validate` method not implemented on caller: #{ self.class }"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cliutils-2.2.6 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.2.5 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.2.4 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.2.3 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.2.2 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.2.1 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.2.0 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.1.4 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.1.3 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.1.2 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.1.1 lib/cliutils/prefs/pref_validators/pref_validator.rb
cliutils-2.1.0 lib/cliutils/prefs/pref_validators/pref_validator.rb