module FactoryTrace::Helpers::Caller

Public Instance Methods

location() click to toggle source

@return [String] file and line where the original method was called

# File lib/factory_trace/helpers/caller.rb, line 7
def location
  location = caller_locations[1]

  base = Pathname.new(Dir.pwd)
  method = Pathname.new(location.path)

  "#{method.relative_path_from(base)}:#{location.lineno}"
end