The book of Ruth is short, and comes as a pleasant interlude between the turbulent and sometimes barbaric writing in Judges, and the (relative) peace and stability that came with the Kings. Todays reading is much cut about, missing out key facts about others who could more legitimately have fathered the grandfather of the future King David. It is well worth reading the whole book in one sitting, if you can get the chance. You will need to remember that when a husband died, then the brothers in law had a duty to raise sons from the widow, so that she has someone to care for her - especially if she has been left childless, or her sons have already died (as in the case of Ruth).
In this case however, although a kinsman of her former husband was available, he did not want to pass his inheritance down Ruth's family line - so he gave over his 'right' or duty to Boaz.
Despite the report that Boaz was only physically the Father of Obed, the short Genealogy at the end of the book says that Boaz was legitimately the father of Obed, Father of Jesse, Father of David.
It is noticeable how the relationships between the women in the book of Ruth are so positive.