From: Pit Capitain Date: 2007-03-04T02:12:26+09:00 Subject: Re: define a function inside a method Olivier Renaud schrieb: > I wrote a method which uses recursion, internally. As a test, I tried to > define the recursive function inside the method that is called : > > class Ga > def bu > def zo(n) > # recursively call zo > end > 10.times {|n| zo(n)} > end In addition to the other answers, if you really want method-internal methods, you can use lambdas: class Ga def bu zo = lambda {|n| # recursively call zo } 10.times {|n| zo.call(n)} end end Regards, Pit