class Prism::ParseWarning

This represents a warning that was encountered during parsing.

Attributes

level[R]

The level of this warning.

location[R]

A Location object representing the location of this warning in the source.

message[R]

The message associated with this warning.

type[R]

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

new(type, message, location, level) click to toggle source

Create a new warning object with the given message and location.

# File prism/parse_result.rb, line 500
def initialize(type, message, location, level)
  @type = type
  @message = message
  @location = location
  @level = level
end

Public Instance Methods

deconstruct_keys(keys) click to toggle source

Implement the hash pattern matching interface for ParseWarning.

# File prism/parse_result.rb, line 508
def deconstruct_keys(keys)
  { type: type, message: message, location: location, level: level }
end
inspect() click to toggle source

Returns a string representation of this warning.

# File prism/parse_result.rb, line 513
def inspect
  "#<Prism::ParseWarning @type=#{@type.inspect} @message=#{@message.inspect} @location=#{@location.inspect} @level=#{@level.inspect}>"
end