Depending on whether you are looking at a Christian Old Testament or the Jewish version changes where exactly the story of Ruth appears. In the Christian Bible, the book of Ruth is placed between the books of Judges and Samuel. In the Hebrew Bible, it appears in the "Writings" section between Song of Songs and Lamentations. Regardless of where the book is placed, the story of Ruth tells readers the same story. We read about Ruth, a Moabite woman, that accepts the god of the Israelites and the Israelite people as her own. Ruth famously tells her mother-in-law, Naomi, that she will go with her wherever she goes and take on the customs and beliefs of that area.
Ruth's devotion to Naomi impresses Boaz, and due to the customs of the time, Ruth and Boaz are allowed to be married. In chapter 4 of Ruth, readers are told that Ruth and Boaz had a son, and then verse 17 gives readers a critical piece of information. Ruth's son was Obed. Obed was the father of Jesse, and Jesse was the father of David (the eventual king of Israel). David was king of Israel around 1000 BCE. This means that Ruth lived 3 generations prior to David's reign. While there isn't a definitive length of time for a "generation," a biblical generation is generally assumed to be much longer than today's generations. Sources generally agree that a biblical generation is around 60–90 years in length. 80 x 3 = 240 years. David is said to have been born around 1035 BCE. 240 years prior to that would be 1275 BC; therefore the story of Ruth occurred around 1300 BCE, which does coincide with the time of Ehud.