class Prism::Comment

This represents a comment that was encountered during parsing. It is the base class for all comment types.

Attributes

location[R]

The location of this comment in the source.

Public Class Methods

new(location) click to toggle source

Create a new comment object with the given location.

# File prism/parse_result.rb, line 199
def initialize(location)
  @location = location
end

Public Instance Methods

deconstruct_keys(keys) click to toggle source

Implement the hash pattern matching interface for Comment.

# File prism/parse_result.rb, line 204
def deconstruct_keys(keys)
  { location: location }
end
trailing?() click to toggle source

This can only be true for inline comments.

# File prism/parse_result.rb, line 209
def trailing?
  false
end