From: Paul Brannan Date: 2001-12-20T23:41:44+09:00 Subject: [ruby-talk:29120] Re: overriding methods: (almost) a replacement for alias_method On Thu, Dec 20, 2001 at 05:49:11PM +0900, Benoit Cerrina wrote: > what is instance_method, I can't find the doc for it in programming ruby? > Benoit It takes a symbol representing a method in a class or module, and returns an UnboundMethod. The UnboundMethod cannot be called, because there is no object on which to call the method. However, you can call bind() on the UnboundMethod, which returns a Method object that can be called. For example: s = "0xff" um = String.instance_method(:hex) # unbound method m1 = s.method(:hex) # bound method #1 m2 = um.bind(s) # bound method #2 p m1.call() #=> 255 p m2.call() #=> 255 Paul