123456789_123456789_123456789_123456789_123456789_

Class: Prism::EmbDocComment

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Comment
Instance Chain:
self, Comment
Inherits: Prism::Comment
Defined in: lib/prism/parse_result.rb,
prism/extension.c

Overview

EmbDocComment objects correspond to comments that are surrounded by =begin and =end.

Class Method Summary

Comment - Inherited

.new

Create a new comment object with the given location.

Instance Attribute Summary

Comment - Inherited

#location

The Location of this comment in the source.

#trailing?

Returns true if this comment happens on the same line as other code and false if the comment is by itself.

Instance Method Summary

  • #inspect Internal use only

    Returns a string representation of this comment.

Comment - Inherited

#slice

Returns the content of the comment by slicing it from the source code.

#deconstruct_keys

Implement the hash pattern matching interface for Comment.

Constructor Details

This class inherits a constructor from Prism::Comment

Instance Attribute Details

#trailing?Boolean (readonly)

Returns false. This can only be true for inline comments.

[ GitHub ]

  
# File 'lib/prism/parse_result.rb', line 738

def trailing?
  false
end

Instance Method Details

#inspect

This method is for internal use only.

Returns a string representation of this comment.

[ GitHub ]

  
# File 'lib/prism/parse_result.rb', line 745

def inspect # :nodoc:
  "#<Prism::EmbDocComment @location=#{location.inspect}>"
end