From: Prime@... Date: 2007-02-21T11:15:13+09:00 Subject: Re: Checking what a method has returned 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 def downloadImg(name) puts "called the download function" end @domains.each do |domain| if checkCache(domain) downloadImg(domain) end end On 2007-02-20 17:51:48 -0800, Chris Gallagher said: > well the reason im doing this is for refoactoring purposes so my code is > chaning a lot. > > What I have at the moment is: > > file = 'public/images/' + source_url + '.jpg' > if ((FileTest.exists?(file))&&((Time.new-File.stat(file).mtime)< > 50000)) > > > > ................. > > Im guessing I can stick a 'return true' just below that or does it work > that way?