Class
InlineComment
objects are the most common. They correspond to comments in the source file like this one that start with #.
Instance Methods
#
lib/prism/parse_result.rb
View on GitHub
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/parse_result.rb, line 396
def inspect
"#<Prism::InlineComment @location=#{location.inspect}>"
end
Returns a string representation of this comment.
lib/prism/parse_result.rb
View on GitHub
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/parse_result.rb, line 391
def trailing?
!location.start_line_slice.strip.empty?
end
Returns true if this comment happens on the same line as other code and false if the comment is by itself.