import functools


def askable(*prompts):
    """
    Decorator to ask the user if they want to perform a certain operation
    before the method proceeds.

    Parameters:
    ----------
    prompts: :obj:iter
        A series of prompts to display to the user when asking if they want
        to skip the operation.
    """
    def decorator(func):
        @functools.wraps(func)
        def inner(instance, *args, **kwargs):
            if "ask" in kwargs and kwargs["ask"] is False:
                return func(instance, *args, **kwargs)
            instance.prompt(*prompts)
            if instance.query_boolean():
                return func(instance, *args, **kwargs)
        return inner
    return decorator