Module: Kernel

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

Instance Method Summary collapse

Instance Method Details

#sender(i = 0) ⇒ Object


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

def sender(i = 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 + i) }
  frame_self
end