def bool_mapper(attribute):
    """
    Maps ``yes``, ``1`` and ``on`` to ``True`` and ``no``, ``0``
    and ``off`` to ``False``.
    """

    def _fn(values):
        if values["bool"].lower() in ("yes", "1", "on", "true"):
            return {attribute: True}
        elif values["bool"].lower() in ("no", "0", "off", "false"):
            return {attribute: False}
        return {}

    return _fn