Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/byebug.rb

Instance Method Summary collapse

Instance Method Details

#debug_method(meth) ⇒ Object

Wraps the meth method with Byebug.start … block.



332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/byebug.rb', line 332

def debug_method(meth)
  old_meth = "__debugee_#{meth}"
  old_meth = "#{$1}_set" if old_meth =~ /^(.+)=$/
  alias_method old_meth.to_sym, meth
  class_eval <<-EOD
  def #{meth}(*args, &block)
    Byebug.start do
      byebug 2
      #{old_meth}(*args, &block)
    end
  end
  EOD
end