Skip to content

Commit

Permalink
Add to_dict method
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Jul 25, 2024
1 parent a09bc24 commit 1e73249
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/aiochris/link/linked.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ class LinkedModel(Linked, abc.ABC):
A class where its fields may be API links.
"""

def to_dict(self) -> dict:
"""Serialize this object."""
return serde.to_dict(self)

@classmethod
def _has_link(cls, name: str) -> bool:
return any(name == field for field in cls._field_names())
Expand Down

0 comments on commit 1e73249

Please sign in to comment.