Class: Prism::Comment
Overview
This represents a comment that was encountered during parsing. It is the base class for all comment types.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
The location of this comment in the source.
Instance Method Summary collapse
-
#deconstruct_keys(keys) ⇒ Object
Implement the hash pattern matching interface for Comment.
-
#initialize(location) ⇒ Comment
constructor
Create a new comment object with the given location.
Constructor Details
#initialize(location) ⇒ Comment
Create a new comment object with the given location.
233 234 235 |
# File 'lib/prism/parse_result.rb', line 233 def initialize(location) @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
The location of this comment in the source.
230 231 232 |
# File 'lib/prism/parse_result.rb', line 230 def location @location end |
Instance Method Details
#deconstruct_keys(keys) ⇒ Object
Implement the hash pattern matching interface for Comment.
238 239 240 |
# File 'lib/prism/parse_result.rb', line 238 def deconstruct_keys(keys) { location: location } end |