Ruby snippet