Created
July 27, 2019 07:59
-
-
Save jasongorman/543c6565b5b5a9fc72846a206c4c969c 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 Warehouse { | |
constructor(catalogue) { | |
this.catalogue = catalogue; | |
} | |
receive(batch){ | |
const {title, artist, copies} = batch.cds[0]; | |
const cd = this.catalogue.search(title, artist); | |
cd.addStock(copies); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment