Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created July 27, 2019 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/d4d76ae3b59b1b60242c1c978124d97c to your computer and use it in GitHub Desktop.
Save jasongorman/d4d76ae3b59b1b60242c1c978124d97c to your computer and use it in GitHub Desktop.
class Warehouse {
constructor(catalogue) {
this.catalogue = catalogue;
}
receive(batch){
const {title, artist, copies} = batch.cds[0];
const cd = this.catalogue.search(title, artist);
cd.stock += copies;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment