Skip to content

Commit

Permalink
Call if callable
Browse files Browse the repository at this point in the history
  • Loading branch information
tan-z-tan committed Aug 9, 2023
1 parent 47f14bf commit 74f735b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyfireconsole/models/pyfire_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ def as_json(self, recursive: bool = False, include: list[str] = [], excepts: lis
data[name] = attr.as_json(recursive=recursive)
elif isinstance(attr, PyfireDoc):
data[name] = attr.as_json(recursive=recursive)
elif callable(attr):
data[name] = attr()
else:
data[name] = attr

Expand Down

0 comments on commit 74f735b

Please sign in to comment.