Skip to content

Commit d960602

Browse files
committed
Add detailed docstrings for Uuid4 class and its methods to enhance documentation and clarify functionality.
1 parent 1a72469 commit d960602

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pyvalueobjects/strings/uuid4.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,23 @@
55

66

77
class Uuid4(NonEmptyString):
8+
"""
9+
A value object representing a UUID version 4 string. Inherits from NonEmptyString and validates that the input is a valid UUID v4 string.
10+
"""
811

912
def __init__(self, value: str):
13+
"""
14+
Initialize the Uuid4 object with the given UUID v4 string value.
15+
:param value: A UUID v4 string value.
16+
"""
1017
super().__init__(value)
1118

1219
def _validate(self, value):
20+
"""
21+
Validate that the given value is a valid UUID v4 string.
22+
:param value: The value to validate.
23+
:raises: ValueObjectError if the value is not a valid UUID v4 string.
24+
"""
1325
super()._validate(value)
1426
try:
1527
uuid.UUID(str(value), version=4)

0 commit comments

Comments
 (0)