-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc.js
More file actions
37 lines (32 loc) · 782 Bytes
/
Copy pathc.js
File metadata and controls
37 lines (32 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const Capsulate = require('../../')
const Field = Capsulate()
class C {
constructor(_field){
Field(this, _field)
}
getPrivate(){
return Field(this)
.private.get('name')
}
setPrivate(name){
return Field(this)
.private.set('name', name)
}
getProtected(){
return Field(this)
.protected.get('A', 'age')
}
setProtected(age){
return Field(this)
.protected.set('A', 'age', age)
}
getProtectedStatic(){
return Field(this)
.protectedStatic.get('A', 'version')
}
setProtectedStatic(version){
return Field(this)
.protectedStatic.set('A', 'version', version)
}
}
module.exports = C