From: Chris Gallagher Date: 2007-02-21T09:11:22+09:00 Subject: Checking what a method has returned Hi, Im looking for a way of checking whether a method has returned true or false. for example i have an want to start off by checking if an image is already stored locally by calling " def checkCache". If the image is already there it will simply come back the process is complete. If it isnt there already it will need to call another method which will be called "downloadImage". What I have for this at the moment is far from complete so feel free to change it around: def index @domains = ['yahoo.com','google.com'] domains_length = @domains.length domains_length.times { |i| ######## if checkCache finds that there is no image present then it needs to #########proceed to the next method which would be downloadImage. checkCache(@domains[i]) downloadImage(@domains[i]) end } end def checkCache .... .... end def downloadImage .... .... end Please help me out on this one, I'm a little bit lost. If the question seems a bit vague or crazy please say so.. Cheers, Chris -- Posted via http://www.ruby-forum.com/.