You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kubsu-sm5-ruby/lab2
Artem-Darius Weber a9717abae8
refactor: simplify Student initialization and move name validation to class method
1 week ago
..
README.md feat: add BinarySearchTree and enhance Student class with birth_date and validation methods 2 weeks ago
binary_search_tree.rb feat: add BinarySearchTree class and integrate birth_date handling in Student class LAB 3 TASK 4 2 weeks ago
contact.rb refactor: convert instance validation methods to class methods in Contact class 1 week ago
main.rb refactor: rename info method to get_single_contact in Contact class and update references 1 week ago
output_students.txt feat: add BinarySearchTree class and integrate birth_date handling in Student class LAB 3 TASK 4 2 weeks ago
person.rb refactor: rename info method to get_single_contact in Contact class and update references 1 week ago
student.rb refactor: simplify Student initialization and move name validation to class method 1 week ago
student_repository.rb refactor: update Student class initialization and validation; add StudentRepository for file operations 4 weeks ago
student_short.rb feat: add validation setters in Contact class and refine Person and StudentShort classes 1 week ago
students.txt feat: implement testing functions for Contact, Person, Student, and StudentShort classes; add sample student data 4 weeks ago

README.md

Lab 2

Диаграмма классов:

classDiagram
    class BinarySearchTree {
        - root : Node
        + add(student : Student) : void
        + each(&block) : void
        - insert(node : Node, student : Student) : Node
        - in_order_traversal(node : Node, &block) : void
    }

    class Node {
        - student : Student
        - left : Node
        - right : Node
        + Node(student : Student)
    }

    class Contact {
        - phone : String?
        - telegram : String?
        - email : String?
        + Contact(phone : String?, telegram : String?, email : String?)
        + valid_phone_number() : Boolean
        + valid_telegram() : Boolean
        + valid_email() : Boolean
        + present() : Boolean
        + info() : String
        - validate_contacts()
        + new_from_info(info_string : String) : Contact
    }

    class Person {
        - id : String
        - git : String
        - contact : Contact
        + Person(id : String, git : String, contact : Contact)
        + git_present() : Boolean
        + contact_present() : Boolean
        + contact_info() : String
        + valid_git(git : String) : Boolean
        + valid_id(id : String) : Boolean
        - validate_person()
    }

    class StudentRepository {
        + read_from_txt(file_path : String) : List~Student~
        + write_to_txt(file_path : String, students : List~Student~)
    }

    class StudentShort {
        - surname_initials : String
        - contact : Contact
        + StudentShort(id : String, git : String, surname_initials : String, contact : Contact)
        + from_student(student : Student) : StudentShort
        + from_string(id : String, info_string : String) : StudentShort
        + to_s() : String
    }

    class Student {
        - surname : String
        - name : String
        - patronymic : String
        - birth_date : Date
        + Student(id : String, git : String, contact : Contact, surname : String, name : String, patronymic : String, birth_date : Date)
        + from_string(student_string : String) : Student
        + surname_and_initials() : String
        + to_s() : String
        + get_info() : String
        - validate_student()
    }

    BinarySearchTree o-- Node
    Node o-- Student
    Contact <|-- Person
    Person <|-- Student
    Person <|-- StudentShort
    Student <.. StudentRepository