You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
306 B

3 years ago
  1. export class RoleItem {
  2. constructor(
  3. public id: number,
  4. public name: string
  5. ) {}
  6. static valueOf(
  7. { id, name }:
  8. { id: number, name: string }
  9. ): RoleItem{
  10. return new RoleItem(id, name)
  11. }
  12. toObject(): Object {
  13. return {
  14. id: this.id,
  15. name: this.name
  16. }
  17. }
  18. }