from pathlib import Path


class ReportSaver:
    """
    Module for saving reports.
    """

    def __init__(self, folder: Path) -> None:
        self.folder = folder

    def save(self, report_body: str) -> Path:
        """
        Saves the report to the results' folder
        :param report_body: Report body text
        :return: Path to the saved report
        """
        report_path = self.folder.joinpath("report.html")
        report_path.write_text(report_body, encoding="utf-8")
        return report_path
