Exception: Regexp::Scanner::ValidationError
- Inherits:
-
ScannerError
- Object
- StandardError
- Parser::Error
- ScannerError
- Regexp::Scanner::ValidationError
- Defined in:
- lib/regexp_parser/scanner/errors/validation_error.rb
Overview
Base for all scanner validation errors
Direct Known Subclasses
InvalidBackrefError, InvalidGroupError, InvalidGroupOption, InvalidSequenceError, UnknownPosixClassError, UnknownUnicodePropertyError
Class Method Summary collapse
-
.for(type, problem, reason = nil) ⇒ Object
Centralizes and unifies the handling of validation related errors.
- .types ⇒ Object
Class Method Details
.for(type, problem, reason = nil) ⇒ Object
Centralizes and unifies the handling of validation related errors.
5 6 7 |
# File 'lib/regexp_parser/scanner/errors/validation_error.rb', line 5 def self.for(type, problem, reason = nil) types.fetch(type).new(problem, reason) end |
.types ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/regexp_parser/scanner/errors/validation_error.rb', line 9 def self.types @types ||= { backref: InvalidBackrefError, group: InvalidGroupError, group_option: InvalidGroupOption, posix_class: UnknownPosixClassError, property: UnknownUnicodePropertyError, sequence: InvalidSequenceError, } end |