main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
738 bytes
|
Line | |
---|
1 | const KeyValuePair = require('../KeyValuePair');
|
---|
2 | const Element = require('./Element');
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * @class MemberElement
|
---|
6 | *
|
---|
7 | * @param {Element} key
|
---|
8 | * @param {Element} value
|
---|
9 | * @param meta
|
---|
10 | * @param attributes
|
---|
11 | */
|
---|
12 | module.exports = class MemberElement extends Element {
|
---|
13 | constructor(key, value, meta, attributes) {
|
---|
14 | super(new KeyValuePair(), meta, attributes);
|
---|
15 |
|
---|
16 | this.element = 'member';
|
---|
17 | this.key = key;
|
---|
18 | this.value = value;
|
---|
19 | }
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * @type Element
|
---|
23 | */
|
---|
24 | get key() {
|
---|
25 | return this.content.key;
|
---|
26 | }
|
---|
27 |
|
---|
28 | set key(key) {
|
---|
29 | this.content.key = this.refract(key);
|
---|
30 | }
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * @type Element
|
---|
34 | */
|
---|
35 | get value() {
|
---|
36 | return this.content.value;
|
---|
37 | }
|
---|
38 |
|
---|
39 | set value(value) {
|
---|
40 | this.content.value = this.refract(value);
|
---|
41 | }
|
---|
42 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.