Class: Prism::ParseWarning
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/prism/parse_result.rb, prism/extension.c |
Overview
This represents a warning that was encountered during parsing.
Class Method Summary
-
.new(message, location) ⇒ ParseWarning
constructor
Create a new warning object with the given message and location.
Instance Attribute Summary
Instance Method Summary
-
#deconstruct_keys(keys)
Implement the hash pattern matching interface for
ParseWarning
. -
#inspect
Returns a string representation of this warning.
Constructor Details
.new(message, location) ⇒ ParseWarning
Create a new warning object with the given message and location.
Instance Attribute Details
#location (readonly)
A Location object representing the location of this warning in the source.
# File 'lib/prism/parse_result.rb', line 338
attr_reader :location
#message (readonly)
The message associated with this warning.
# File 'lib/prism/parse_result.rb', line 335
attr_reader :
Instance Method Details
#deconstruct_keys(keys)
Implement the hash pattern matching interface for ParseWarning
.
# File 'lib/prism/parse_result.rb', line 347
def deconstruct_keys(keys) { message: , location: location } end
#inspect
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