Question - Explain the use of retry statement in Ruby?
Answer -
Usaually in a rescue clause, the exception is captured and code resumes after begin block. Using retry statement, the rescue block code can be resumed from begin after capturing an exception.
Syntax:
begin
code....
rescue
# capture exceptions
retry # program will run from the begin block
end