Created
November 4, 2019 04:01
-
-
Save fmo91/3827adcdea5ba9c9c43ba202559f7c77 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
class ProductsCalculator { | |
// ... | |
func calculateTotal(using taxesCalculator: TaxesCalculatorType) -> Double { | |
let subtotal = products.map({ $0.price }).reduce(0, +) | |
return taxesCalculator.applyTaxes(to: subtotal) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment