From: dblack@... Date: 2007-02-21T11:19:52+09:00 Subject: Re: Checking what a method has returned Hi -- On Wed, 21 Feb 2007, Prime@ruby-lang.org wrote: > I do not know if this will help you out, I think this is what you > wanted. This only calls the downloadImg method if the file exists. > > > @domains = ['yahoo.com','google.com'] > > def checkCache(filename) > if File.exists?(filename) > return true > else > return false > end > end Save your fingers some work :-) def check_cache(filename) File.exists?(filename) end File.exists? already returns true or false, so you don't have to wrap it. In fact, if all you want to do is check file existence, you're probably best off just using File.exists? directly. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)