Module MethodSource::MethodExtensions
In: lib/method_source.rb

This module is to be included by `Method` and `UnboundMethod` and provides the `source` functionality

Methods

comment   included   source  

Public Class methods

We use the included hook to patch Method#source on rubinius. We need to use the included hook as Rubinius defines a `source` on Method so including a module will have no effect (as it‘s higher up the MRO). @param [Class] klass The class that includes the module.

Public Instance methods

Return the comments associated with the method as a string. @return [String] The method‘s comments as a string @raise SourceNotFoundException

@example

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

Return the sourcecode for the method as a string @return [String] The method sourcecode as a string @raise SourceNotFoundException

@example

 Set.instance_method(:clear).source.display
 =>
    def clear
      @hash.clear
      self
    end

[Validate]