-
Notifications
You must be signed in to change notification settings - Fork 16
⭐ Refactor classes ✏️Write teacher class and modules #23
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?
⭐ Refactor classes ✏️Write teacher class and modules #23
Conversation
| "High five!" | ||
| end | ||
|
|
||
| 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.
Usually for modules that are going to be included in classes, we use "-able" names, so here it'd be HighFiveable. Module names should be related to the methods that are defined in it.
|
|
||
| def set_performance_rating(rating) | ||
| response = "" | ||
| if rating > 90 |
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.
set_performance_rating is still common between the ApprenticeTeacher and SeniorTeacher classes. How will you extract it ?
| "Cool, I've always wanted to teach phase #{num}!" | ||
| end | ||
|
|
||
| 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.
There are still some common methods between the Student and Teacher classes.
For eg: name, age, phase methods exist in both the classes.
How will you refactor this?
| response = "Listen, class, this is how everything works. *drops crazy knowledge bomb* ... 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 Teacher and ApprenticeTeacher classes except for a few words. Can you think of a way to extract it into the Parent class?
No description provided.