<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_cubes(self):
 """ List all available JSON files. """

        for file_name in os.listdir(self.directory):
            if '.' in file_name:
                name, ext = file_name.rsplit('.', 1)
                if ext.lower() == 'json':
                    yield name