Crumble saffron into a small bowl of hot water and set aside.
Cover the bottom of one or more frying pans with oil. When the oil is very hot, add a single layer of eggplant and fry until golden. Turn and repeat – each slice should be golden brown and tender. Transfer to platter lined with paper towels. Repeat with remaining eggplant, adding more oil if necessary.
Meanwhile, heat olive oil in small frying pan, add onion, garlic, and herbs, and sauté over low heat for 10-15 minutes, until soft. Add tomatoes, increase heat, and cook about 15 minutes, until thickened. Season with salt, pepper, and, if necessary, sugar.
Meanwhile, beat eggs, then add ricotta, milk, saffron water, Parmesan, salt, and pepper.
Preheat oven to 350. Spread about a cup of tomato sauce on the bottom of the baking dish, then cover with an overlapping layer of eggplant. Sprinkle with salt, pepper, and half of the basil, torn into pieces. Top with Gruyère, then another layer of eggplant and basil, then the rest of the tomato sauce. Carefully spread the ricotta/saffron custard on top.
Bake about 40 minutes, until golden and slightly puffy. Remove from oven and let cool for 5 minutes. Serve with something neutral like rice, pasta, or mashed potatoes.