Class: Lutaml::Xsd::Validation::BaseTypes::StringValidator
- Inherits:
-
BaseTypeValidator
- Object
- BaseTypeValidator
- Lutaml::Xsd::Validation::BaseTypes::StringValidator
- Defined in:
- lib/lutaml/xsd/validation/base_types/string_validator.rb
Overview
Validates XSD string type
The string type represents character strings in XML. All values are valid strings unless additional facets restrict them.
Instance Method Summary collapse
-
#error_message(value) ⇒ String
Generate error message for invalid string.
-
#valid?(value) ⇒ Boolean
Validate value is a valid string.
Methods inherited from BaseTypeValidator
Instance Method Details
#error_message(value) ⇒ String
Generate error message for invalid string
34 35 36 |
# File 'lib/lutaml/xsd/validation/base_types/string_validator.rb', line 34 def (value) "Value '#{value}' is not a valid string (cannot be nil)" end |
#valid?(value) ⇒ Boolean
Validate value is a valid string
26 27 28 |
# File 'lib/lutaml/xsd/validation/base_types/string_validator.rb', line 26 def valid?(value) !value.nil? end |