'Save composite ring metadata to given file. See
:class:`CompositeRingBuilder` for details of the persisted metadata
format.
:param path_to_file: Absolute path to a composite ring file
:raises ValueError: if no composite ring has been built yet with this
instance'

def save(self, path_to_file):

    if ((not self.components) or (not self._builder_files)):
        raise ValueError('No    composed    ring    to    save.')
    with open(path_to_file, 'wb') as fp:
        metadata = self.to_dict()
        metadata['saved_path'] = os.path.abspath(path_to_file)
        metadata['serialization_version'] = 1
        json.dump(metadata, fp)
