2
I’m making a Ruby repetition structure using the following structure:
begin
[código]
end <while/until> [condição]
But the Rubocop, which I use as a tool for linting, says I should use the Kernel#loop
with break
. Thus:
loop do
[código]
break <if/unless> [condição]
end
Why? In which cases should the begin-end-while/until
? What advantages the Kernel#loop
above brings in relation to the structure I used?