-
Notifications
You must be signed in to change notification settings - Fork 16
New feature #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
New feature #16
Conversation
| response += "... You're welcome." | ||
| response | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
teach_stuff method is common in both the SeniorTeacher and ApprenticeTeacher classes except for a few words. Can you think of a way to extract it into the Parent class?
| "High five!" | ||
| end | ||
|
|
||
| end No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
|
||
| class Student < People | ||
| include HighFiveable | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class names should be singular. Class name should have been "Person" here.
class Student < Person
end|
|
||
| class TeachingPosition < People | ||
|
|
||
| attr_accessor :num, :target_raise, :salary, :number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reads as "a Teaching position is a kind of person" which doesn't sound quite right. A good alternative would be to call the class name "Teacher" instead of "TeachingPosition"
class ApprenticeTeacher < Teacher -> Apprentice teacher is a Teacher
end
class SeniorTeacher < Teacher -> Senior teacher is a Teacher
end
class Teacher < Person -> Teacher is a Person
end
class Student < Person -> Student is a Person
end
No description provided.