Soak the beans overnight in plenty of cold water to cover. Drain the beans and cover with plenty of fresh water. Bring to a boil over high heat. Cook the beans over medium-high heat for 1 1/2 hours, until beans are easily mashed with a fork. Drain the beans, add the garlic, rosemary, olive oil, ricotta, and salt and pepper, to taste, and mash the bean and cheese mixture with a fork or in the bowl of a food processor. Mixture should be pliable but not completely homogenous. Set aside.
Mound 3 1/2 cups of the flour in the center of a large wooden cutting board. Make a well in the middle of the flour and add the eggs and the olive oil. Using a fork, beat together the eggs and oil and begin to incorporate the flour, starting with the inner rim of the well.
As you expand the well, keep pushing the flour up from the base of the mound to retain the well shape. The dough will come together when half of the flour is incorporated.
Start kneading the dough with both hands, using the palms of your hands. Once you have a cohesive mass, remove the dough from the board and scrape up and discard any leftover bits. Lightly reflour the board and continue kneading for 6 more minutes. The dough should be elastic and a little sticky. Wrap the dough in plastic and allow to rest for 30 minutes at room temperature.
Divide the pasta dough into 3 balls of equal size, and roll each out to the thinnest setting on a pasta-rolling machine. Cut each sheet into 4-inch squares. Place a tablespoon of the bean mixture in the center of each square. Fold each square in half, corner to corner, to form a triangle, then fold the other corners around to meet each other and form the tortelloni. Place the tortelloni on a sheet tray dusted with flour until ready to cook.
Bring 6 quarts of water to a boil and add 2 tablespoons salt.
In a 14 to 16-inch saute pan, heat the butter over medium-high heat until it foams and subsides.
Meanwhile, drop the tortelloni in the boiling water and cook 2 minutes. Drain the pasta, reserving the cooking liquid, and add to the pan with the butter. Add the thyme leaves and a splash of the pasta cooking water, and toss over high heat for 1 minute, to coat and emulsify. Divide the pasta evenly among 4 warmed pasta bowls, grate the cheese over each serving, and serve immediately.
Recipe copyright 2000, Mario Batali. All Rights Reserved.