def from_dict(cls, dictionary):
        """Create a MetadataRb instance from a dict."""
        cookbooks = set()
        # put these in order
        groups = [cookbooks]

        for key, val in dictionary.items():
            if key == 'depends':
                cookbooks.update({cls.depends_statement(cbn, meta)
                                  for cbn, meta in val.items()})

        body = ''
        for group in groups:
            if group:
                body += '\n'
            body += '\n'.join(group)
        return cls.from_string(body)
def from_dict ( cls , dictionary ) : cookbooks = set ( ) groups = [ cookbooks ] for key , val in dictionary . items ( ) : if key == 'depends' : cookbooks . update ( { cls . depends_statement ( cbn , meta ) for cbn , meta in val . items ( ) } ) body = '' for group in groups : if group : body += '\n' body += '\n' . join ( group ) return cls . from_string ( body )
Create a MetadataRb instance from a dict.