class Prism::ParseWarning

This represents a warning that was encountered during parsing.

Attributes

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

The message associated with this warning.

Public Class Methods

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

# File lib/prism/parse_result.rb, line 341
def initialize(message, location)
  @message = message
  @location = location
end

Public Instance Methods

Implement the hash pattern matching interface for ParseWarning.

# File lib/prism/parse_result.rb, line 347
def deconstruct_keys(keys)
  { message: message, location: location }
end

Returns a string representation of this warning.

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