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 def to_s "Student: #{@surname} #{@name} #{@patronymic}\n" \ "ID: #{@id || 'N/A'}\n" \ "Phone: #{@phone || 'N/A'}\n" \ "Telegram: #{@telegram || 'N/A'}\n" \ "Email: #{@email || 'N/A'}\n" \ "Git: #{@git || 'N/A'}" end end