Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
[MINOR]: Added standard report function
Browse files Browse the repository at this point in the history
  • Loading branch information
amadolid committed Jul 12, 2024
1 parent 0a78064 commit 7dc9c71
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jaclang/core/architype.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,17 @@ def serialize(self) -> dict[str, object]:
),
}

def report(self) -> dict[str, object]:
"""Report Anchor."""
return {
"id": self.ref_id,
"context": (
asdict(self.architype)
if is_dataclass(self.architype) and not isinstance(self.architype, type)
else {}
),
}

def __hash__(self) -> int:
"""Override hash for anchor."""
return hash(self.ref_id)
Expand Down

0 comments on commit 7dc9c71

Please sign in to comment.