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(type, message, location, level) ⇒ ParseWarning
constructor
Create a new warning object with the given message and location.
Instance Attribute Summary
Instance Method Summary
-
#deconstruct_keys(keys)
Internal use only
Implement the hash pattern matching interface for
ParseWarning. -
#inspect
Internal use only
Returns a string representation of this warning.
Constructor Details
.new(type, message, location, level) ⇒ ParseWarning
Create a new warning object with the given message and location.
Instance Attribute Details
#level (readonly)
The level of this warning.
# File 'lib/prism/parse_result.rb', line 848
attr_reader :level #: Symbol
#location (readonly)
A Location object representing the location of this warning in the source.
# File 'lib/prism/parse_result.rb', line 845
attr_reader :location #: Location
#message (readonly)
The message associated with this warning.
# File 'lib/prism/parse_result.rb', line 842
attr_reader : #: String
#type (readonly)
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.
# File 'lib/prism/parse_result.rb', line 839
attr_reader :type #: Symbol
Instance Method Details
#deconstruct_keys(keys)
This method is for internal use only.
Implement the hash pattern matching interface for ParseWarning.
#inspect
This method is for internal use only.
Returns a string representation of this warning.
# File 'lib/prism/parse_result.rb', line 870
def inspect # :nodoc: "#<Prism::ParseWarning @type=#{@type.inspect} @message=#{@message.inspect} @location=#{@location.inspect} @level=#{@level.inspect}>" end