View Single Post
  #27  
Old 04-09-2008, 08:09 PM
shaalini shaalini is offline
D-Web Architect
 
Join Date: Apr 2007
Posts: 632
shaalini is on a distinguished road
Default Re: Ruby BuiltIn functions

singleton_method_added
singleton_method_added( aFixnum ) -> nil


Invoked with a symbol id whenever a singleton method is added to a module or a class. The default implementation in Kernel ignores this, but subclasses may override the method to provide specialized functionality.

class Test
def Test.singleton_method_added(id)
puts "Added #{id.id2name} to Test"
end
def a() end
def Test.b() end
end
def Test.c() end

produces:

Added singleton_method_added to Test
Added b to Test
Added c to Test
__________________
Shaalini.S
Be the Best of Whatever you are...
Reply With Quote