Module: Flexr::Diagnostics
- Defined in:
- lib/flexr/diagnostics.rb
Class Method Summary collapse
- .error(code, message, location: nil, help: nil, note: nil) ⇒ Object
- .raise!(diagnostic) ⇒ Object
- .warning(code, message, location: nil, help: nil, note: nil) ⇒ Object
Class Method Details
.error(code, message, location: nil, help: nil, note: nil) ⇒ Object
81 82 83 |
# File 'lib/flexr/diagnostics.rb', line 81 def error(code, , location: nil, help: nil, note: nil) Diagnostic.new(code: code, severity: :error, message: , location: location, help: help, note: note) end |
.raise!(diagnostic) ⇒ Object
89 90 91 92 |
# File 'lib/flexr/diagnostics.rb', line 89 def raise!(diagnostic) klass = diagnostic.code == "FLEXR-E014" ? UnsupportedRegexpError : CompileError raise klass.new(diagnostic., diagnostic: diagnostic) end |
.warning(code, message, location: nil, help: nil, note: nil) ⇒ Object
85 86 87 |
# File 'lib/flexr/diagnostics.rb', line 85 def warning(code, , location: nil, help: nil, note: nil) Diagnostic.new(code: code, severity: :warning, message: , location: location, help: help, note: note) end |