ruby snippet