destructureSelf method

void destructureSelf()

Implementation

void destructureSelf() {
  final parts = this._api._destructureMembershipStatus(this._box.borrow());
  switch (parts.tag) {
    case 0:
      this._tag = MembershipStatusTag.Admin;

      break;
    case 1:
      this._tag = MembershipStatusTag.Mod;

      break;
    case 2:
      this._tag = MembershipStatusTag.Custom;

      break;
    case 3:
      this._tag = MembershipStatusTag.Regular;

      break;
    default:
      throw new StateError(
          "Destructuring enum gave back an invalid tag: ${parts.tag}");
  }
}