Module: T::Private::CallerUtils

Defined in:
lib/types/private/caller_utils.rb

Overview

typed: false

Class Method Summary collapse

Class Method Details

.find_callerObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/types/private/caller_utils.rb', line 6

def self.find_caller
  skiped_first = false
  Thread.each_caller_location do |loc|
    unless skiped_first
      skiped_first = true
      next
    end

    next if loc.path&.start_with?("<internal:")

    return loc if yield(loc)
  end
  nil
end