Class: Prism::InlineComment
- Defined in:
- lib/prism/parse_result.rb,
ext/prism/extension.c
Overview
InlineComment objects are the most common. They correspond to comments in the source file like this one that start with #.
Instance Attribute Summary
Attributes inherited from Comment
Instance Method Summary collapse
-
#inspect ⇒ Object
Returns a string representation of this comment.
-
#trailing? ⇒ Boolean
Returns true if this comment happens on the same line as other code and false if the comment is by itself.
Methods inherited from Comment
#deconstruct_keys, #initialize, #slice
Constructor Details
This class inherits a constructor from Prism::Comment
Instance Method Details
#inspect ⇒ Object
Returns a string representation of this comment.
537 538 539 |
# File 'lib/prism/parse_result.rb', line 537 def inspect "#<Prism::InlineComment @location=#{location.inspect}>" end |
#trailing? ⇒ Boolean
Returns true if this comment happens on the same line as other code and false if the comment is by itself.
532 533 534 |
# File 'lib/prism/parse_result.rb', line 532 def trailing? !location.start_line_slice.strip.empty? end |