Method: MethodSource::MethodExtensions#comment

Defined in:
lib/method_source.rb

#commentString

Return the comments associated with the method as a string.

Examples:

Set.instance_method(:clear).comment.display
=>
   # Removes all elements and returns self.

Returns:

  • (String)

    The method's comments as a string

Raises:

  • SourceNotFoundException



126
127
128
# File 'lib/method_source.rb', line 126

def comment
  MethodSource.comment_helper(source_location, defined?(name) ? name : inspect)
end