Skip to content

Commit ff241eb

Browse files
Adding docstring to class method
1 parent 4a17d8b commit ff241eb

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

pages/screening_subject_search/record_request_to_cease_page.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from pages.screening_subject_search.record_informed_dissent_page import (
1313
RecordInformedDissentPage,
1414
)
15+
from typing import Optional
1516

1617

1718
class RecordRequestToCeasePage(BasePage):
@@ -134,14 +135,16 @@ def is_immediate_cease(self) -> bool:
134135
return self._is_immediate_cease_reason
135136

136137
@classmethod
137-
def get_by_reason(cls, reason: str):
138-
for member in cls:
139-
if member.reason == reason:
140-
return member
141-
return None
142-
143-
@classmethod
144-
def by_description_case_insensitive(cls, reason: str):
138+
def by_description_case_insensitive(
139+
cls, reason: str
140+
) -> Optional["ReasonForCeasing"]:
141+
"""
142+
Get ReasonForCeasing member by description, case insensitive.
143+
Args:
144+
reason (str): The reason description to look for.
145+
Returns:
146+
Optional[ReasonForCeasing]: The matching ReasonForCeasing member, or None if not found.
147+
"""
145148
reason_lower = reason.lower()
146149
for member in cls:
147150
if member.reason.lower() == reason_lower:

0 commit comments

Comments
 (0)