Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfsaavedra committed Apr 24, 2024
1 parent a2e362b commit 046a18b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions glitch/repr/inter.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ def __init__(
def __repr__(self) -> str:
return self.code.strip().split("\n")[0]

def to_dict(self) -> Dict[str, Any]:
def as_dict(self) -> Dict[str, Any]:
return {
**super().as_dict(),
"condition": self.condition,
"type": self.type.name,
"is_default": self.is_default,
"else_statement": self.else_statement.to_dict()
"else_statement": self.else_statement.as_dict()
if self.else_statement
else None,
}
Expand All @@ -104,7 +104,7 @@ def __init__(self, content: str) -> None:
def __repr__(self) -> str:
return self.content

def to_dict(self) -> Dict[str, Any]:
def as_dict(self) -> Dict[str, Any]:
return {
**super().as_dict(),
"content": self.content,
Expand All @@ -131,7 +131,7 @@ def as_dict(self) -> Dict[str, Any]:
"name": self.name,
# FIXME: In Puppet code, the value can be a ConditionalStatement or a dict.
# The types need to be fixed.
"value": self.value if not isinstance(self.value, CodeElement) else self.value.to_dict(), # type: ignore
"value": self.value if not isinstance(self.value, CodeElement) else self.value.as_dict(), # type: ignore
"has_variable": self.has_variable,
"keyvalues": [kv.as_dict() for kv in self.keyvalues],
}
Expand Down

0 comments on commit 046a18b

Please sign in to comment.