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.
Artem-Darius Weber
5ec7fb96d1
|
1 week ago | |
---|---|---|
.. | ||
README.md | 1 week ago | |
binary_search_tree.rb | 2 weeks ago | |
main.rb | 1 week ago | |
output_students.txt | 2 weeks ago | |
person.rb | 1 week ago | |
student.rb | 1 week ago | |
student_repository.rb | 4 weeks ago | |
student_short.rb | 1 week ago | |
students.txt | 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 Person {
- id : String
- git : String
- phone : String?
- telegram : String?
- email : String?
+ Person(id : String, git : String, phone: String, telegram: String, email: String)
+ phone=(String) : Boolean
+ telegram=(String) : Boolean
+ email=(String) : Boolean
+ self.valid_phone_number() : Boolean
+ self.valid_telegram() : Boolean
+ self.valid_email() : Boolean
+ git_present() : Boolean
+ contact_present() : Boolean
+ contact_info() : String
+ git=(git : String) : void
- validate_id(id: String) : void
- validate_git(git : String) : void
- validate_contact(contact : Contact) : void
- valid_git?(git : String) : Boolean
- valid_id?(id : String) : Boolean
}
class StudentRepository {
+ self.read_from_txt(file_path : String) : List~Student~
+ self.write_to_txt(file_path : String, students : List~Student~)
}
class StudentShort {
- surname_initials : String
+ StudentShort(id : String, surname_initials : String, phone: String, telegram: String, email: String)
+ self.from_student(student : Student) : StudentShort
+ self.from_string(id : String, info_string : String) : StudentShort
+ to_s() : String
}
class Student {
- surname : String
- name : String
- patronymic : String
- birth_date : Date
- const NAME_REGEX : String
+ Student(id : String, git : String, phone: String, telegram: String, email: String, surname : String, name : String, patronymic : String, birth_date : Date)
+ self.from_string(student_string : String) : Student
+ surname_and_initials() : String
+ to_s() : String
+ get_info() : String
+ surname=(surname : String)
+ name=(name : String)
+ patronymic=(patronymic : String)
+ birth_date=(birthdate : String)
+ self.valid_name?(name : String) : Boolean
- name_initial(name : String) : String
- patronymic(patronymic : String) : String
}
BinarySearchTree o-- Node
Node o-- Student
Person <|-- Student
Person <|-- StudentShort
Student <.. StudentRepository