But he who had knowledge of the Book , said : ' I will bring it to you before your glance comes back to you ' And when he saw it set before him , he ( Solomon ) said : ' This is a favor from my Lord that He might test me whether I am thankful or ungrateful . Whosoever gives thanks gives thanks only for his ( own soul 's ) good , but he who is ungrateful , truly my Lord is Rich and Generous '