Add detailed comments to all functions in class.c including:
- Function purpose and behavior descriptions
- Parameter documentation with types and meanings
- Return value explanations with all possible outcomes
- Error conditions and exception documentation
- Helper function and structure documentation
This improves code maintainability and follows Ruby documentation
conventions with proper call-seq formatting.
Co-authored-by: Atlassian Rovo Dev