Class: Prism::ParseWarning
Overview
This represents a warning that was encountered during parsing.
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
The level of this warning.
-
#location ⇒ Object
readonly
A Location object representing the location of this warning in the source.
-
#message ⇒ Object
readonly
The message associated with this warning.
Instance Method Summary collapse
-
#deconstruct_keys(keys) ⇒ Object
Implement the hash pattern matching interface for ParseWarning.
-
#initialize(message, location, level) ⇒ ParseWarning
constructor
Create a new warning object with the given message and location.
-
#inspect ⇒ Object
Returns a string representation of this warning.
Constructor Details
#initialize(message, location, level) ⇒ ParseWarning
Create a new warning object with the given message and location.
348 349 350 351 352 |
# File 'lib/prism/parse_result.rb', line 348 def initialize(, location, level) @message = @location = location @level = level end |
Instance Attribute Details
#level ⇒ Object (readonly)
The level of this warning.
345 346 347 |
# File 'lib/prism/parse_result.rb', line 345 def level @level end |
#location ⇒ Object (readonly)
A Location object representing the location of this warning in the source.
342 343 344 |
# File 'lib/prism/parse_result.rb', line 342 def location @location end |
#message ⇒ Object (readonly)
The message associated with this warning.
339 340 341 |
# File 'lib/prism/parse_result.rb', line 339 def @message end |
Instance Method Details
#deconstruct_keys(keys) ⇒ Object
Implement the hash pattern matching interface for ParseWarning.
355 356 357 |
# File 'lib/prism/parse_result.rb', line 355 def deconstruct_keys(keys) { message: , location: location, level: level } end |
#inspect ⇒ Object
Returns a string representation of this warning.
360 361 362 |
# File 'lib/prism/parse_result.rb', line 360 def inspect "#<Prism::ParseWarning @message=#{@message.inspect} @location=#{@location.inspect} @level=#{@level.inspect}>" end |