Created
January 6, 2018 19:23
-
-
Save Sihui/3e26d28ae4b22c693b6a05bcbfeb6e17 to your computer and use it in GitHub Desktop.
Design Pattern: Builder and Car
This file contains hidden or 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
class CarConstructionDirector | |
def construct_car(builder:) | |
builder.build_car_frame | |
builder.add_engine | |
builder.add_front_wheels | |
builder.add_back_wheels | |
builder.add_dashboard | |
builder.add_energy_source | |
builder.car | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment