add ruby implementation