Ruby implementation

NBD