From 9baafc80ed889c232587cf5d4cfaa2db44d1825a Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Sun, 20 Nov 2022 15:13:16 +0000 Subject: feat: Hand ranking API Hand ranking API with a health check root endpoint and rank endpoint. --- poker/constants.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'poker/constants.py') diff --git a/poker/constants.py b/poker/constants.py index e0a7348..6402ef7 100644 --- a/poker/constants.py +++ b/poker/constants.py @@ -17,6 +17,11 @@ class Rank(IntEnum): PAIR = 9 HIGH_CARD = 10 + def __str__(self) -> str: + """Return string representation.""" + out: str = self.name.lower().replace("_", " ").title() + return out + class Suit(AutoName): """Card suit enum.""" @@ -46,7 +51,7 @@ class Value(IntEnum): def __str__(self) -> str: """Return string representation.""" - if self.value in [1, 11, 12, 13]: + if self.value in [1, 11, 12, 13, 14]: out: str = self.name.lower() else: out = str(self.value) -- cgit v1.2.3