Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit d9bdccf

Browse files
committed
made to_boolean_strict a private method of LiteralBoolean
1 parent 5db98a8 commit d9bdccf

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

python/selfie-lib/selfie_lib/Literals.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ def encode(
4747
) -> str:
4848
return str(value)
4949

50-
def parse(self, string: str, language: Language) -> bool:
51-
return to_boolean_strict(string)
52-
50+
def __to_boolean_strict(self, string: str) -> bool:
51+
if string.lower() == "true":
52+
return True
53+
elif string.lower() == "false":
54+
return False
55+
else:
56+
raise ValueError("String is not a valid boolean representation: " + string)
5357

54-
def to_boolean_strict(string: str) -> bool:
55-
if string.lower() == "true":
56-
return True
57-
elif string.lower() == "false":
58-
return False
59-
else:
60-
raise ValueError("String is not a valid boolean representation: " + string)
58+
def parse(self, string: str, language: Language) -> bool:
59+
return self.__to_boolean_strict(string)

0 commit comments

Comments
 (0)