Is it possible to define a Ruby singleton method using a block?
So, I want to define a singleton method for an object, but I want to do it using a closure. For example, def define_say(obj, msg) def obj.say puts msg end end o = Object.new define_say o, "hello world!" o.say This doesn't work because defining a singleton method via "def" is not a closure, so I get an exception that "msg" is...