{% capture generalizations %}{% assign inheritance = klass.associations | where: “member_end_type”, “inheritance” %}{% for assoc in inheritance %}{{ assoc.member_end }} {% endfor %}{% endcapture %}

[{{ klass.name }}-section]
cols=“1a”

|=== |*{{ klass.name }}* |

cols=“1,4”

!=== ! Definition: ! {{ klass.definition }} ! Subclass of: ! {% if generalizations.size > 4 %}{{ generalizations }}{% else %}None{% endif %} ! Stereotype: ! «{{ klass.stereotype }}» {% if klass.constraints.size > 0 %} {% for constraint in klass.constraints %} ! Constraint: ! {{ constraint.body }}: {{ constraint.definition | replace: '|', '|' }} {% endfor %} {% endif %} !===

{% if klass.associations.size > 0 %} {% capture rendered_associations %} {% for assoc in klass.associations %}

{% if assoc.member_end_attribute_name.size > 0 %}

% capture cardinality %}{% if assoc.member_end_cardinality.min == ‘C’ %}[0..{{ assoc.member_end_cardinality.max }}]{% elsif assoc.member_end_cardinality.min == ‘M’ and assoc.member_end_cardinality.max == ‘1’ %{% else %}[{{ assoc.member_end_cardinality.max }}]{% endif %}{% endcapture %}

! {{ assoc.member_end_attribute_name }} ! <<{{assoc.member_end}}-section,{{assoc.member_end}}>> {{ cardinality }} ! {{ assoc.definition }}

{% endif %} {% endfor %} {% endcapture %}

{% if rendered_associations.size > 100 %} |

cols=“15,20,60”,options=“header”

!=== ! *Role name* ! *Target class and multiplicity* ! Definition {{ rendered_associations }} !=== {% endif %}

{% endif %} {% if klass.attributes.size > 0 %} |

cols=“15,20,60”,options=“header”

!=== ! Attribute ! *Value type and multiplicity* ! Definition {% for attr in klass.attributes %}

% capture cardinality %}{% if attr.cardinality.min == ‘C’ %}[0..{{ attr.cardinality.max }}]{% elsif assoc.member_end_cardinality.min == ‘M’ and assoc.member_end_cardinality.max == ‘1’ %{% else %}[{{ attr.cardinality.max }}]{% endif %}{% endcapture %}

! {{ attr.name }} !<<{{ attr.type }}-section,{{ attr.type }}>> {{ cardinality }} !{{ attr.definition }}

{% endfor %} !===

| NOTE: Unless otherwise specified, all attributes and role names have the stereotype «Property». {% endif %} |===