def METHOD_NAME(violations):
    """Flatten RuleViolations into a dict for each RuleViolation member.
    Args:
        violations (list): The RuleViolations to flatten.
    Yields:
        dict: Iterator of RuleViolations as a dict per member.
    """
    for violation in violations:
        violation_data = {'resource_id': violation.resource_id,
                          'full_name': violation.full_name,
                          'rotation_period': violation.rotation_period,
                          'state': violation.state,
                          'protection_level': violation.protection_level,
                          'algorithm': violation.algorithm,
                          'purpose': violation.purpose}
        yield {
            'resource_id': violation.resource_id,
            'resource_type': violation.resource_type,
            'resource_name': violation.resource_id,
            'full_name': violation.full_name,
            'rule_index': violation.rule_index,
            'rule_name': violation.rule_name,
            'violation_type': violation.violation_type,
            'violation_data': violation_data,
            'resource_data': violation.resource_data
        }