Make the method from e6831e for enums a classmethod