The book of Ruth moves the biblical narrative along in a way that it makes a connection between the times of the judges and the soon arrival of the Kings of Israel.
Deuteronomy 25:5–6 (NAS): 5 When brothers live together and one of them dies and has no son, the wife of the deceased shall not be married outside the family to a strange man. Her husband’s brother shall go in to her and take her to himself as wife and perform the duty of a husband’s brother to her. 6 “It shall be that the firstborn whom she bears shall assume the name of his dead brother, so that his name will not be blotted out from Israel.