def action(self, name, *args, **kwargs):
        """
        Delegates which method to be called for a desired action.

        @param name: The name of the action to execute.
        @type name: str
        @param args: Any arguments for the action.
        @param kwargs: Any keyword arguments for the action.
        """
        try:
            return getattr(self, name)(*args, **kwargs)
        except AttributeError:
            raise AttributeError('Invalid Action.')

        Delegates which method to be called for a desired action.

        @param name: The name of the action to execute.
        @type name: str
        @param args: Any arguments for the action.
        @param kwargs: Any keyword arguments for the action.
        
pypattyrn/behavioral/command.py