ruby class snippet