def validation_command(self, validation_command):
        """Setup validation according to received argument.

        Parameters
        ==========
        validation_command (None  or callable)
            check __init__ method's docstring for more
            info.
        """
        ### if validation_command is None, validation
        ### always passes, no matter what value is set

        if validation_command is None:
            command = lambda value: True

        ### if it is a callable, it is used.

        elif callable(validation_command):
            command = validation_command

        ### otherwise, it isn't a legal value, so raise
        ### an error

        else:

            raise ValueError("'validation_command' argument isn't" " an allowed value.")

        ### finally, check whether the text received
        ### is valid and store the command on the
        ### appropriate attribute

        ## retrieve text
        text = self.cursor.get_text()

        ## check text

        # try validating
        try:
            result = command(text)

        # if an exception occurred while validating,
        # catch the exception and raise a new exception
        # from it, explaining the context of such
        # error

        except Exception as err:

            raise RuntimeError(
                "An exception was raised while using the"
                " specified validation command on the"
                " provided text"
            ) from err

        # if validation works and result is false,
        # raise a value error

        else:

            if not result:

                raise ValueError(
                    "the 'validation_command' received"
                    " doesn't validate the 'text' received."
                )

        ## finally, let's store the validation command
        self._validation_command = command
Setup validation according to received argument.

        Parameters
        ==========
        validation_command (None  or callable)
            check __init__ method's docstring for more
            info.
        
nodezator/textman/editor/main.py