Avoiding Wet Code
Wet code, which stands for write every time, is code that has duplicate elements. Code that is not wet is called dry code, which stands for don’t repeat yourself. If your code is wet, what could be a simple update can become a headache requiring you to make multiple updates over many files instead of one update in one location.
To avoid wet code when creating classes, you can have one class inherit the methods of another class when the inheriting class has all the same functionality as the inherited class. To do this, you can use Class2 < Class1 where Class2 is the one inheriting the methods.
You are also able to add data to the initialize method of the inheriting class. To prevent the second initialize from overwriting the first, super should be added under the def line of the second one.
In instances where two classes share one method but not the others, you can create a module that would then be referenced by each class. The module allows the method to exist outside of the classes and can therefore be written once.
