From: "Yugui (Yuki Sonoda)" Date: 2009-07-15T19:25:42+09:00 Subject: [ruby-core:24345] Re: [Bug #1664] Kernel#define_singleton_method not documented [patch] Thank you. The patch was applied except the last sentence. On 6/20/09 7:58 PM, Marc-Andre Lafortune wrote: > If a block is specified, it is used as the method body. This block > is evaluated using instance_eval. define_singleton_method just define a method into the singleton class. It does not use instance_eval. So it works differently from instance_eval. module M obj = Object.new obj.instance_eval do T = Class.new p T.name #=> nil end obj.define_singleton_method(:a) do T = Class.new p T.name #=> M::T end obj.a end -- Yugui