Module MethodSource
In: lib/method_source.rb
lib/method_source/source_location.rb
lib/method_source/version.rb

Methods

Classes and Modules

Module MethodSource::MethodExtensions
Module MethodSource::ReeSourceLocation
Module MethodSource::SourceLocation

Constants

VERSION = "0.7.0"

Public Class methods

Helper method responsible for opening source file and buffering up the comments for a specified method. Defined here to avoid polluting `Method` class. @param [Array] source_location The array returned by Method#source_location @return [String] The comments up to the point of the method.

Helper method responsible for extracting method body. Defined here to avoid polluting `Method` class. @param [Array] source_location The array returned by Method#source_location @return [File] The opened source file

Determine if a string of code is a valid Ruby expression. @param [String] code The code to validate. @return [Boolean] Whether or not the code is a valid Ruby expression. @example

  valid_expression?("class Hello") #=> false
  valid_expression?("class Hello; end") #=> true

[Validate]