Class: Prism::ParseWarning
| Relationships & Source Files | |
| Inherits: | Object | 
| Defined in: | lib/prism/parse_result.rb | 
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)  
    
    
Implement the hash pattern matching interface for
ParseWarning. - 
    
      #inspect  
    
    
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 656
attr_reader :level
#location (readonly)
A Location object representing the location of this warning in the source.
# File 'lib/prism/parse_result.rb', line 653
attr_reader :location
#message (readonly)
The message associated with this warning.
# File 'lib/prism/parse_result.rb', line 650
attr_reader :
#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 647
attr_reader :type
Instance Method Details
#deconstruct_keys(keys)
Implement the hash pattern matching interface for ParseWarning.
#inspect
Returns a string representation of this warning.
# File 'lib/prism/parse_result.rb', line 672
def inspect "#<Prism::ParseWarning @type=#{@type.inspect} @message=#{@message.inspect} @location=#{@location.inspect} @level=#{@level.inspect}>" end