If you want to know how to treat immigrants, read the Book of Ruth. I have been rereading it in anticipation of the holiday of Shavuot in a few weeks, when the book is chanted in the synagogue. I’m amazed at how my views have changed over the years. I used to regard the two protagonists, Ruth and Naomi, as somewhat dull, somewhat stock characters representing goodness, but projecting little excitement. Well, that has changed as I have come to understand the difficult and dangerous path these women had to maneuver to sustain their lives. I used to regard Boaz as a nice elderly gentleman, thoughtful, but hardly appealing. That has certainly changed as I’ve recognized his extraordinary sensitivity in easing the plight of the women, beyond the call of duty.

But I am getting ahead of myself. We don’t usually think of Ruth and Naomi as immigrants in any way related to the immigration issues grabbing today’s headlines. Yet, so much of their narrative fits just that profile. Naomi is twice a migrant. As the book opens she, her husband Elimelech and their two sons have immigrated to Moab from Judah, where a famine has overtaken the land. Later sages chastise Elimelech, whom they imagine to have been well off, for not having stayed put and helped others during those hard times, implying that the subsequent problems stem from his selfishness. Be that as it may, Naomi bears the brunt of suffering when Elimelech dies followed by the death of their sons. She has nothing now but her widow’s weeds and two Moabite daughters-in-law, whom she has no means of supporting in that land. She convinces one of them, Orpah, to remain with her own parents, but Ruth refuses to abandon her, declaring in words that have reverberated through the ages, “wherever you go, I will go … your people shall be my people and your God my God.”

The two women set off alone for Bethlehem in Judah. They go on foot, carrying their few belongings, like refugees in every period, like my husband and his family when they walked across Europe to escape the Nazis. It is a hazardous trek for the women, alone and unprotected in a lawless era, when the Judges ruled and chaos reigned everywhere. Strictly speaking Naomi is not an immigrant; she is returning to her own land. But she is like a stranger there. “Can this be Naomi?” people ask, so bitter and beaten down has she become. For Ruth it is all new and confusing. Stalked by hunger she has to find a way to feed them both, and she does this by gleaning in the corners of a field, where ears of grain have been left for the poor. The regular reapers are aware that she is an outsider. The men have been warned not to molest her and all the laborers told to allow her to glean “without interference” and “not to scold her.” Undoubtedly some resent this destitute foreign woman, whom their boss invited to join them at lunch. Will she take work away from them?

The boss, of course, is Boaz. Before he learns of any familial connection, he admires Ruth for having left her father and mother and “gone to a people you never knew,” much as in the distant past his ancestor Abraham left his land, his birthplace and his father’s house to follow a vision. Boaz admires how hard Ruth works to feed her mother-in-law and herself. And when he learns that he is a “redeeming kinsman” he immediately assumes responsibility for that role.

In this Boaz is contrasted with an unnamed closer kinsman simply called “Ploni Almoni.” He is an ordinary John Doe fellow, not unlike, for example, those who were willing to send money to help Jewish refugees during their darkest hour, but not assume the burden of sponsoring any by bringing them to this country. He agrees to buy Naomi’s land, as Jewish law required of such a kinsman, but he’s too invested in his own estate to also marry Ruth, equally required by law. Boaz steps forward to redeem the land and marry Ruth, and — as we know —  from that union will eventually come the great King David.

Throughout the Book of Ruth, variations on the word chesed, “lovingkindness,” appear and reappear, like musical refrains. Naomi and Ruth treat each other with lovingkindness and Boaz deals kindly with both women. Not every immigrant is as loyal or hardworking as Ruth, and yes, nations need to establish standards and rules for accepting foreigners. But the vast majority of people who leave their homes and ancestral lands for unfamiliar surroundings do so in order to find safety and a new chance at life. “Lovingkindness” is a good word to keep in mind in deciding their fate.

Francine Klagsbrun’s latest book is “The Fourth Commandment: Remember the Sabbath Day.” Her new biography of Golda Meir will be published in October.