Abstract implementation into Ruby