Class: CLIUtils::PrefValidator
- Inherits:
-
Object
- Object
- CLIUtils::PrefValidator
- Includes:
- Messaging
- Defined in:
- lib/cliutils/prefs/pref_validators/pref_validator.rb
Overview
The generic base class for a Pref Validator.
Direct Known Subclasses
AlphabeticValidator, AlphanumericValidator, DateValidator, DatetimeValidator, FilepathExistsValidator, NonNilValidator, NumberValidator, TimeValidator, UrlValidator
Instance Attribute Summary collapse
-
#is_valid ⇒ Boolean
Holds whether the validator returned successful or not.
-
#message ⇒ String
Holds the message to display to the user when the Validator fails.
Instance Method Summary collapse
-
#validate(text = nil) ⇒ void
Validate the Validator!.
Methods included from Messaging
Instance Attribute Details
#is_valid ⇒ Boolean
Holds whether the validator returned successful or not.
10 11 12 |
# File 'lib/cliutils/prefs/pref_validators/pref_validator.rb', line 10 def is_valid @is_valid end |
#message ⇒ String
Holds the message to display to the user when the Validator fails.
15 16 17 |
# File 'lib/cliutils/prefs/pref_validators/pref_validator.rb', line 15 def @message end |
Instance Method Details
#validate(text = nil) ⇒ void
This method returns an undefined value.
Validate the Validator!
22 23 24 |
# File 'lib/cliutils/prefs/pref_validators/pref_validator.rb', line 22 def validate(text = nil) fail "`validate` method not implemented on caller: #{ self.class }" end |