Calling Method of A GameObject's Script

I have a List of GameObjects. All these GameObjects are of prefab. This prefab has a script. Is it possible to cast the GameObjects in the List to this prefab and then call a method in the prefab’s script? Is there a better way to do this? Thanks in advanced. Here is my pseudocode.

public class EngineScript
{
   public gameObject prefabObject;
   List<GameObject> listOfPrefabObjects;
   void doStufff()
  {
     foreach(GameObject objectFoo in listOfPrefabObjects)
     {
          //how to call doFunStuff?
     }
 }
}

public class prefabScript //prefab has this
{
   public void doFunStuff()
   {
        //stuff done
   }
}

foreach(GameObject objectFoo in listOfPrefabObjects)
{
objectFoo .Getcomponent().doFunStuff();
}

et voila :]