It is probable that there was a family book for the house of Pharez, in which their genealogies were preserved, and important bits of history were recorded; and that the Book of Ruth was compiled from it. (See the note at Genesis 2:4)
Related Commentaries of Ruth 4:18
Ruth 4:18
18 Now these are the generations of Pharez: Pharez begat Hezron,