Module: MethodSource::SourceLocation::ProcExtensions

Includes:
ReeSourceLocation
Included in:
Proc
Defined in:
lib/method_source/source_location.rb

Instance Method Summary (collapse)

Instance Method Details

- (Array) source_location

Return the source location for a Proc (in implementations without Proc#source_location)

Returns:

  • (Array)

    A two element array. First element is the file, second element is the line in the file where the proc definition is found.



64
65
66
67
# File 'lib/method_source/source_location.rb', line 64

def source_location
  self.to_s =~ /@(.*):(\d+)/
  [$1, $2.to_i]
end