|
|
|
|
require_relative 'student'
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
student_string = "Норакет Норакет Норакет | ID: 2 | Phone: +1234567890 | Telegram: @nora | Email: nora@example.com | Git: https://github.com/nora"
|
|
|
|
|
student_from_string = Student.from_string(student_string)
|
|
|
|
|
puts "Создан объект из строки:\n#{student_from_string}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
student1 = Student.new(
|
|
|
|
|
surname: 'Алексеевич',
|
|
|
|
|
name: 'Артем-Дариус',
|
|
|
|
|
patronymic: 'Вебер',
|
|
|
|
|
id: 1,
|
|
|
|
|
git: 'https://git.djft.ru'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
student1.set_contacts(
|
|
|
|
|
phone: '+79891242223',
|
|
|
|
|
telegram: '@alstroemeria22',
|
|
|
|
|
email: 'no-replay@djft.ru'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
puts student1.get_info
|
|
|
|
|
puts "Surname and Initials: #{student1.surname_and_initials}"
|
|
|
|
|
puts "Git Info: #{student1.git_info}"
|
|
|
|
|
puts "Contact Info: #{student1.contact_info}"
|
|
|
|
|
|
|
|
|
|
student2 = Student.new(
|
|
|
|
|
surname: 'Норакет',
|
|
|
|
|
name: 'Норакет',
|
|
|
|
|
patronymic: 'Фамилия'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
student2.set_contacts(
|
|
|
|
|
phone: '+70000000000'
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
puts student1
|
|
|
|
|
puts '-' * 40
|
|
|
|
|
puts student2
|
|
|
|
|
rescue ArgumentError => e
|
|
|
|
|
puts "Ошибка: #{e.message}"
|
|
|
|
|
end
|