Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created July 27, 2019 09:05
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/8e3eb582a8d90f0027c8a205c2d21fc8 to your computer and use it in GitHub Desktop.
Save jasongorman/8e3eb582a8d90f0027c8a205c2d21fc8 to your computer and use it in GitHub Desktop.
receive(batch){
const {title, artist, copies} = batch.cds[0];
let cd = this.catalogue.search(title, artist);
if(cd == null){
cd = new CD(0, 0, new Description(title, artist));
this.catalogue.add(cd);
}
cd.addStock(copies);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment