I am not 100% sure that the question is here ...
myschool.students[2].first_name School students, ( - , ), .
class School
attr_reader :students
def initialize()
@students = []
end
end
myschool.students[2] -. , students Student, :
class Student
attr_reader :first_name, :last_name
def initialize(first, last)
@first_name = first
@last_name = last
end
end
myschool.students[2].first_name .
mystudent.school.address School Student <<212 > School.
, School Student , - . :
class School
def add_student(student)
@students << student
student.school = self
end
end
class Student
attr_accessor :school
end
address , , , , .