def METHOD_NAME(self, obj):
    """recursively compile or reveal refs and convert obj to yaml and write to file"""
    indent = self.kwargs.get("indent", 2)
    reveal = self.kwargs.get("reveal", False)
    target_name = self.kwargs.get("target_name", None)
    if reveal:
        obj = self.revealer.reveal_obj(obj)
    else:
        obj = self.revealer.compile_obj(obj, target_name=target_name)
    if obj:
        if isinstance(obj, Mapping):
            yaml.dump(
                obj,
                stream=self.fp,
                indent=indent,
                Dumper=PrettyDumper,
                default_flow_style=False,
            )
        else:
            yaml.dump_all(
                obj,
                stream=self.fp,
                indent=indent,
                Dumper=PrettyDumper,
                default_flow_style=False,
            )
        logger.debug("Wrote %s", self.fp.name)
    else:
        logger.debug("%s is Empty, skipped writing output", self.fp.name)