Module: Kernel

Defined in:
lib/delayed/core_ext/kernel.rb

Instance Method Summary collapse

Instance Method Details

#sender(idx = 0) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/delayed/core_ext/kernel.rb', line 4

def sender(idx = 0)
  frame_self = nil
  # 3. one for the block, one for this method, one for the method calling this
  # method, and _then_ we get to the self for who sent the message we want
  RubyVM::DebugInspector.open { |dc| frame_self = dc.frame_self(3 + idx) }
  frame_self
end