How can you have an IEnumerator edit the value passed to it?

To keep it short and simple, I have an IEnumerator, and it has a GameObject passed to it as one of the arguments.
Is there a way to, for example, disable the GameObject in the IEnumerator? I’ve tried using ref, but that doesn’t work in iterators.

Any info is appreciated.

Just have another variable in the class called something like ienumeratorGameObject

Before you call the IEnumerator, just set the variable to whatever you need. So for example.

public GameObject ienumeratorGameObject;

void RunMe (GameObject go) {
    ienumeratorGameObject = go;
    StartCoroutine(WaitForMe());
}

IEnumerator WaitForMe () {
    yield return new WaitForSeconds(1f);
    ienumeratorGameObject.SetActive(false);
}

Alternatively just have a local variable if you need to change it inside the method

IEnumerator WaitForMe (GameObject go) {
    GameObject ienumeratorGameObject = go;
    // change ienumeratorGameObject here
    yield return new WaitForSeconds(1f);
    ienumeratorGameObject.SetActive(false);
}