What is wrong with that set/get?
class Pupil
def name
@name
end
def name=(name)
@name = name
end
def age
@age
end
def age=(age)
@age
end
end
Further, if there were a child class with three arguments, name, age, gender, the recruitment method would only be received by the child for sex only. Can you show the set / get method and initialize in the child class.
source
share