Skip to content

Instantly share code, notes, and snippets.

@chiefGui
Last active August 29, 2015 14:04
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 chiefGui/b1c8757574dac3d96542 to your computer and use it in GitHub Desktop.
Save chiefGui/b1c8757574dac3d96542 to your computer and use it in GitHub Desktop.
/**
* Em referência à https://gist.github.com/guisouza/8c592323f833d981cf1c
**/
/**
* No exemplo, o gato come Fish
* e depois come Food, mas pela lógica,
* Fish e Food já devem existir: ele não
* pode comer algo abstrato.
*
* Portanto...
**/
var salmon = new Fish({ name: 'Salmon' })
, potato = new Food({ name: 'Potato' });
steveTheCat.eat(salmon);
steveTheCat.eat(potato);
anAnimal.eat(steveTheCat);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment