From: Neville Franks Date: 2007-02-06T08:32:53+09:00 Subject: Code explanation requeted Hi, Can someone please shed some light on the following code: --- def test_listen s = nil log = Object.new class << log; self end.__send__(:define_method, :to_int) { s.close 2 } inet_stream do |s| assert_raise(IOError) { s.listen(log) } end end --- In particular the "class" statement and "self end.__send__(:define_method, :to_int)" Is this actually a class and where is its "end"? I didn't know you can have a class inside a method. So I'm confused here as well. This code is messing up the Ruby parser I'm working on in my IDE. --- Neville Franks, http://www.getsoft.com http://www.surfulater.com -- Posted via http://www.ruby-forum.com/.