Skip to Content Skip to Search

This represents a warning that was encountered during parsing.

Methods
D
I
N

Attributes

[R] location

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

[R] message

The message associated with this warning.

Class Public methods

new(message, location)

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

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

Instance Public methods

deconstruct_keys(keys)

Implement the hash pattern matching interface for ParseWarning.

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

inspect()

Returns a string representation of this warning.

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