Ruby/Reflection/set trace func

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск

Версия 17:10, 26 мая 2010

Trace function

class Test 
    def test 
        a =1 
        b = 2 
    end 
end 
set_trace_func proc {|event, file, line, id, binding, classname| 
    printf "%8s %s:%2d %10s %8s\n", event, file, line, id, classname 
} 
t = Test.new 
t.test