Created
April 4, 2017 00:04
-
-
Save talyssonoc/6b53513d3b2c7dfaa9299fd310e8c8a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { attributes } = require('structure'); | |
const User = attributes({ | |
id: Number, | |
name: { | |
type: String, | |
required: true | |
}, | |
age: Number | |
})(class User { | |
isLegal() { | |
return this.age >= User.MIN_LEGAL_AGE; | |
} | |
}); | |
User.MIN_LEGAL_AGE = 21; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment