Last active
January 25, 2021 14:32
-
-
Save chrsp/2b32243e5261879a22c3ce3904397753 to your computer and use it in GitHub Desktop.
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
// Module: Data | |
import Domain | |
public struct: ItalianCooker: CookerProtocol { | |
func cook(_ recipe: Recipe) { | |
switch recipe { | |
case recipe is SpaghettiCarbonara: | |
cookSpaghettiCarbonara(recipe) | |
default: | |
print("Cooker doesn't know how to cook the recipe requested") | |
} | |
private func cookSpaghettiCarbonara(_ carbonara: SpaghettiCarbonara) { | |
// do something with the carbonara ingredients | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment