7
Inizia, salva e assicurati in Ruby?
Di recente ho iniziato a programmare in Ruby e sto esaminando la gestione delle eccezioni. Mi chiedevo se ensurefosse l'equivalente di Ruby finallyin C #? Dovrei avere: file = File.open("myFile.txt", "w") begin file << "#{content} \n" rescue #handle the error here ensure file.close unless file.nil? end o dovrei farlo? #store …