Restructured Ruby code