class Prism::ParseWarning
This represents a warning that was encountered during parsing.
Attributes
The level of this warning.
A Location object representing the location of this warning in the source.
The message associated with this warning.
The type of warning. This is an internal symbol that is used for communicating with translation layers. It is not meant to be public API.
Public Class Methods
Source
# File lib/prism/parse_result.rb, line 641 def initialize(type, message, location, level) @type = type @message = message @location = location @level = level end
Create a new warning object with the given message and location.
Public Instance Methods
Source
# File lib/prism/parse_result.rb, line 649
def deconstruct_keys(keys)
{ type: type, message: message, location: location, level: level }
end Implement the hash pattern matching interface for ParseWarning.
Source
# File lib/prism/parse_result.rb, line 654
def inspect
"#<Prism::ParseWarning @type=#{@type.inspect} @message=#{@message.inspect} @location=#{@location.inspect} @level=#{@level.inspect}>"
end Returns a string representation of this warning.
Ruby Core © 1993–2024 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.