Notes on some ruby code