- Created a new superclass `Person` to encapsulate common attributes and methods for `Student` and `StudentShort`.
- Moved validation methods, contact handling, and common logic from `Student` and `StudentShort` into `Person`.
- Updated `Student` to inherit from `Person`, simplifying initialization and validation.
- Updated `StudentShort` to inherit from `Person`, reducing redundancy and aligning with the new superclass structure.
- Improved code maintainability by eliminating duplicated code and clarifying class responsibilities.
- Created StudentShort class with fields: ID, surname initials, git, and contact, which cannot be modified directly.
- Implemented two constructors:
1. One that accepts a Student object to initialize fields.
2. Another that accepts ID and a string containing surname initials, git, and contact information.
- Updated main.rb to test both constructors of StudentShort, ensuring proper field initialization and immutability.
- Added `get_info` method to return a concise summary of the student, including surname with initials, Git link, and primary contact method.
- Implemented individual methods for retrieving surname with initials, Git link, and contact information separately.
- Protected contact fields from direct modification; fields can now only be updated via `set_contacts`.
- Enhanced string parsing with `from_string` constructor to initialize objects directly from formatted strings.
- Updated main file to test new methods and constructor functionality.
- Updated `to_s` method to standardize string representation of Student object.
- Added `from_string` constructor that parses a formatted string and initializes the object with parsed data.
- Modified `set_contacts` to ensure contacts are only set via the defined method.
- Added validation for Git presence and contact details presence, ensuring data integrity.
- Updated tests in main.rb to validate the new constructor and string parsing logic.
- Implemented `set_contacts` method to safely set phone, telegram, and email fields.
- Made contact fields (`phone`, `telegram`, `email`) private and accessible only through `set_contacts`.
- Added validation within `set_contacts` to ensure contact fields are correctly formatted.
- Modified the `initialize` method to utilize `set_contacts` for setting contact values during object creation.
- Added checks in the `validate` method to ensure Git presence and at least one contact method.
- Updated test cases in `main.rb` to demonstrate correct and incorrect uses of contact modifications.
- Ensured that contact fields cannot be modified directly, maintaining data integrity.
- Added `validate` method to ensure each Student object has a Git link and at least one contact method (phone, telegram, or email).
- Implemented `git_present?` method to check the presence of a Git link.
- Implemented `contact_present?` method to check the presence of at least one contact method.
- Modified the constructor to call `validate` during object initialization.
- Added class methods to validate the format of strings for each field:
- `valid_name?` for surname, name, and patronymic (only letters allowed).
- `valid_phone_number?` for phone number (validates 10-15 digits, optional '+' sign).
- `valid_telegram?` for telegram handle (starts with '@' and allows letters, digits, and underscores).
- `valid_email?` for email (standard email format validation).
- `valid_git?` for Git link (validates GitHub URL format).
- Modified the `initialize` constructor:
- Integrated validations for all fields with descriptive error messages.
- Ensured objects cannot be created with invalid data formats.