From: Damjan Rems Date: 2008-05-05T21:36:19+09:00 Subject: Re: Ruby Class documentation Aa Aa wrote: > > In the upper lefthand corner there is Parent: IO, and IO is a >> hyperlink to IO documentation. >> IO contains the close method. > > Thanks, I probably missed that because it doesn't look like something > you can click on :) > >> Related to this: >> >> It's usually better to use block form of File.open, than File.new and >> File#close. >> i.e. >> instead of >> >> f = File.new('xxxx',''w') >> f << "dfsdfsd" >> f.close >> >> do >> >> File.open('xxxx','w') do |f| >> f << "fdfdsfsdf" >> end And can become an oneliner. File.open('xxxx','w') { |f| f << "fdfdsfsdf" } by TheR -- Posted via http://www.ruby-forum.com/.