In a large bowl, mix the flour and salt. Create a well in the center and add the olive oil and egg. Gradually mix in the flour until a dough forms.
Knead the dough on a floured surface until smooth, about 5-7 minutes. If the dough is too dry, add a little water, one tablespoon at a time. Cover with a damp cloth and let it rest for 30 minutes.
In a mixing bowl, combine the chopped spinach, ricotta cheese, Parmesan cheese, cooked ham, toasted pine nuts, nutmeg, salt, and pepper. Mix well.
Roll out the dough on a floured surface until it is about 1/8 inch thick. Cut the dough into squares or circles, about 3-4 inches in size.
Place a spoonful of filling in the center of each square or circle. Fold the dough over the filling to form a half-moon shape or a small pouch. Seal the edges by pressing with a fork or crimping with your fingers.
Heat vegetable oil in a deep pan or fryer to 350°F (175°C).
Fry the barbajuan in batches, being careful not to overcrowd the pan. Cook for about 2-3 minutes per side, or until golden brown and crispy.
Remove from the oil and drain on paper towels.
Enjoy your meal!