-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.rb
More file actions
17 lines (14 loc) · 782 Bytes
/
Copy pathtest.rb
File metadata and controls
17 lines (14 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require_relative "student"
require_relative "bad_student"
require_relative "teacher"
require_relative "head_teacher"
student = Student.new(first_name: "Иван", last_name: "Иванов", patronym: "Иванович", year_of_birth: 2008)
badstudent = BadStudent.new(first_name: "Василий", last_name: "Васильев", patronym: "Васильевич", year_of_birth: 2005)
teacher = Teacher.new(first_name: "Христофор", last_name: "Колумб", patronym: "Бонифатьевич", year_of_birth: 1970)
headteacher = HeadTeacher.new(first_name: "Петр", last_name: "Петров", patronym: "Петрович", year_of_birth: 1975)
persons = [student, badstudent, teacher, headteacher]
persons.each do |p|
puts p.name
puts p.age
puts p.head?
end