C
Chris Gallagher
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)
downloadImage(@domains)
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
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)
downloadImage(@domains)
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