From 57a51641e7b81d74073cde21b56a509f5d75cbad Mon Sep 17 00:00:00 2001 From: Artem Darius Weber Date: Sat, 21 Sep 2024 10:42:58 +0300 Subject: [PATCH] feat: add Student class with required and optional fields --- lab2/README.md | 0 lab2/student.rb | 14 ++++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 lab2/README.md create mode 100644 lab2/student.rb diff --git a/lab2/README.md b/lab2/README.md new file mode 100644 index 0000000..e69de29 diff --git a/lab2/student.rb b/lab2/student.rb new file mode 100644 index 0000000..0f24b54 --- /dev/null +++ b/lab2/student.rb @@ -0,0 +1,14 @@ +class Student + attr_accessor :id, :surname, :name, :patronymic, :phone, :telegram, :email, :git + + def initialize(surname:, name:, patronymic:, id: nil, phone: nil, telegram: nil, email: nil, git: nil) + @surname = surname + @name = name + @patronymic = patronymic + @id = id + @phone = phone + @telegram = telegram + @email = email + @git = git + end + end \ No newline at end of file