Last active
March 20, 2017 14:03
-
-
Save lbrito1/f54b760e7e30a4fffcf210b6d0a627fb to your computer and use it in GitHub Desktop.
Example #2 - Don't obsess over code DRYness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example 2 | |
class Car | |
include Checkups | |
def maintenance_10k | |
basic_maintenance | |
end | |
def maintenance_30k | |
basic_maintenance | |
check_spare_wheel | |
end | |
def maintenance_50k | |
basic_maintenance | |
check_spare_wheel | |
check_gearbox | |
end | |
private | |
def basic_maintenance | |
check_break_fluid | |
check_battery_terminals | |
check_engine_oil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment