Daniel Brumbaugh Keeney
6/13/2008 11:21:00 PM
On Fri, Jun 13, 2008 at 5:34 PM, Michael W. Ryder
<_mwryder@worldnet.att.net> wrote:
> So how would you do something that requires user intervention, say in
> putting more paper in a printer?
def foo
do_something
ensure_printer
do_more
end
def ensure_printer
return true if printer_available?
if confirm 'you're printer has no paper. Try again?'
ensure_printer
else
raise NoPaperError
end
end
That's how I would imagine your problem to look. If there isn't paper,
then it asks the user whether to try again, otherwise, it throws a
NoPaperError which gets handled somewhere.
Daniel Brumbaugh Keeney