Class: Method
- Inherits:
-
Object
- Object
- Method
- Defined in:
- lib/bently/core_ext/method.rb
Instance Method Summary collapse
-
#source_location ⇒ Array
Return the source location of a method for Ruby 1.8.
Instance Method Details
#source_location ⇒ Array
Return the source location of a method for Ruby 1.8.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/bently/core_ext/method.rb', line 41 def source_location if @file.nil? args =[*(1..(arity<-1 ? -arity-1 : arity ))] set_trace_func method(:trace_func).to_proc call(*args) rescue nil set_trace_func nil @file = File.(@file) if @file && File.exist?(File.(@file)) end [@file, @line] if @file end |