TypeEnumerationDescriptor¶
- class dsviper.TypeEnumerationDescriptor(name, *, documentation=None)¶
Bases:
objectDescribes the cases an enum will be created with.
Definitions.create_enumeration() turns the descriptor into a TypeEnumeration.
- add_case(name: str, documentation: str | None = None)¶
Add a case called name to the enum being described.
documentation is carried onto the case.
- cases() list[TypeEnumerationCase]¶
Return the list of cases.
- description() str¶
Return the type spelled out: its cases, then its name.
It reads {}:Name while no case has been added - a shape create_enumeration refuses, an enum requiring at least one case.
- documentation() str¶
Return the documentation the enumeration will be created with, empty when none was given.
- name() str¶
Return the name the enum will be created under.