Module: Kernel

Defined in:
lib/ruby-debug.rb

Instance Method Summary collapse

Instance Method Details

#binding_n(n = 0) ⇒ Object

returns a binding of n-th call frame



197
198
199
200
201
# File 'lib/ruby-debug.rb', line 197

def binding_n(n = 0)
  frame = Debugger.current_context.frames[n+1]
  raise "Unknown frame #{n}" unless frame
  frame.binding 
end

#debugger(steps = 1) ⇒ Object

stops the current thread after a number of steps made.



192
193
194
# File 'lib/ruby-debug.rb', line 192

def debugger(steps = 1)
  Debugger.current_context.stop_next = steps
end