08
Jan
2008
Defining function inside a function using def
The function(s) defined within a function works fine with any hierarchy only within the main object but gives NoMethodError inside a class.
Lets exemplify it!
Here are the example of both main object and inside a class…
Its an unexpected behavior in the main object. I don’t know whether its a bug or the feature. But as Matz says it will be removed in the future version of ruby, might be in 2.0


Working with Vinsol has been one of the most rewarding and productive collaborations I've ever had in the technology industry. Manik is an intelligent and honest engineer with a great faculty for open and clear communication, and his team include some of the swiftest and keenest developers I've ever had the pleasure to work with. They're great value for money, excellent people who are a joy to know and interact with, and above all they really know their stuff