Module: FactoryTrace::Helpers::Caller
- Defined in:
- lib/factory_trace/helpers/caller.rb
Class Method Summary collapse
-
.location ⇒ String
File and line where the original method was called.
Class Method Details
.location ⇒ String
Returns file and line where the original method was called.
9 10 11 12 13 14 15 16 |
# File 'lib/factory_trace/helpers/caller.rb', line 9 def location location = caller_locations(2..2).first base = Pathname.new(Dir.pwd) method = Pathname.new(location.path) "#{method.relative_path_from(base)}:#{location.lineno}" end |