123456789_123456789_123456789_123456789_123456789_

Class: Prism::Translation::Parser::PrismDiagnostic

Relationships & Source Files
Inherits: Prism::Translation::Parser::Diagnostic
  • ::Object
Defined in: lib/prism/translation/parser.rb

Overview

The parser gem has a list of diagnostics with a hard-coded set of error messages. We create our own diagnostic class in order to set our own error messages.

Class Method Summary

Instance Attribute Summary

  • #message readonly

    This is the cached message coming from prism.

Constructor Details

.new(message, level, reason, location) ⇒ PrismDiagnostic

Initialize a new diagnostic with the given message and location.

[ GitHub ]

  
# File 'lib/prism/translation/parser.rb', line 28

def initialize(message, level, reason, location)
  @message = message
  super(level, reason, {}, location, [])
end

Instance Attribute Details

#message (readonly)

This is the cached message coming from prism.

[ GitHub ]

  
# File 'lib/prism/translation/parser.rb', line 25

attr_reader :message