From: "Alan (Ursus Major)" Date: 2002-10-30T10:36:07+09:00 Subject: executing a proc passed as an argument? Folks: This shows what I want, and obviously how NOT to do it. I've apparently got the callback method into @cb, but how on earth do I execute it? ------------------------------------ class Callback def initialize (v, &m) @cb = m #store a callback method @v = v #store an argument to pass the method end def exe # @cb(@v) #execute the stored method (not this way!) p "called exe, value = #{@v}" #stored the value, and p "stored method = #{@cb}" #maybe the proc? end end x = Callback.new("a value", &proc{|v| p v}) x.exe -------------------------------------- Thanks, Alan Walkington