def source_location
return @source_location if @source_location
mod_type_string = wrapped.class.to_s.downcase
file, line = first_method_source_location
return nil if !file.is_a?(String)
class_regexes = [/^\s*#{mod_type_string}\s*(\w*)(::)?#{wrapped.name.split(/::/).last}/,
/^\s*(::)?#{wrapped.name.split(/::/).last}\s*?=\s*?#{wrapped.class}/,
/^\s*(::)?#{wrapped.name.split(/::/).last}\.(class|instance)_eval/]
host_file_lines = lines_for_file(file)
search_lines = host_file_lines[0..(line - 2)]
idx = search_lines.rindex { |v| class_regexes.any? { |r| r =~ v } }
@source_location = [file, idx + 1]
rescue Pry::RescuableException
nil
end