From: "Bartosz DziewoƄski" Date: 2012-08-11T22:24:18+09:00 Subject: Re: Unable to print a block argument. 2012/8/11 Ja Tse : > Not sure how to put it just want to know, wat's the advantage of > creating an object through a proxy method in this case #open vs just > creating an object with the constructor Foo.new ? It might be used if you would have to explicitly call some "destructor" method on the object after you finish using it. E.g. the block form of File.open: File.open(...){|f| do_stuff(f) } ... can be used instead of the longer and more error-prone (if you forget to close the file): f = File.open(...) do_stuff(f) f.close I don't think there is any advantage if there is no such "destructor" method for your object. -- Matma Rex