Skip to content

Commit

Permalink
chapter 03: adding dropbox specific implementation of fileinterface w…
Browse files Browse the repository at this point in the history
…here change Owner has not implementation, this is not be a good example of a good substitute, calling that method will crash the application
  • Loading branch information
devcorpio committed Mar 31, 2019
1 parent 94cb14c commit afc3aa2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions chapter-03-the-liskov-substitution-principle/dropboxFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* In order to improve the understanding of this code, this file it is supposing to implement the following interface:
*
* interface FileInterface {
* function rename(name);
* function changeOwner(user, group);
* }
*
* Quack Quack Quack 🦆 typing :D
*/

function dropboxFile() {
function rename(name) {}

function changeOwner(user, group) {
new Error('Not implemented for Dropbox files');
}

return {
rename,
changeOwner,
};
}

module.exports = dropboxFile;

0 comments on commit afc3aa2

Please sign in to comment.