diff --git a/models/user_model.js b/models/user_model.js index cfdaf43..1293c04 100644 --- a/models/user_model.js +++ b/models/user_model.js @@ -1,10 +1,21 @@ 'use strict'; +const _usernameSymbol = Symbol('username'); +const _passwordSymbol = Symbol('password'); + // Can you notice a problem with reponsibilities of this class? class User { constructor(username, password) { - this.username = username; - this.password = password; + this[_usernameSymbol] = username; + this[_passwordSymbol] = password; + } + + get username() { + return this[_usernameSymbol]; + } + + get password() { + return this[_passwordSymbol]; } static* getUserByUsername(username) { diff --git a/notices.json b/notices.json index 47254df..c66ffd8 100644 --- a/notices.json +++ b/notices.json @@ -1 +1 @@ -[{"id":1,"message":"rre"},{"id":2,"message":"few"}] \ No newline at end of file +[{"id":2,"message":"few"},{"id":2,"message":"dw"}] \ No newline at end of file