@stordata/vsphere-soapify
Version:
A NodeJS abstraction layer for the vSphere SOAP API
26 lines (20 loc) • 715 B
JavaScript
;
const Instance = require('../Instance');
module.exports = class DynamicData extends Instance {
constructor(client, source) {
super(client);
// Iterate over defined mappings to populate this object's properties
this.fill(source);
}
/**
* This builds the list of all subclasses implemented by this instance
* Used to get type information when the object is serialized to JSON, or otherwise used in an environment
* where runtime type information is not available
*/
recordRuntimeClasses() {
this.classes = [];
for (let klass = this.constructor; klass !== DynamicData; klass = Object.getPrototypeOf(klass)) {
this.classes.push(klass.name);
}
}
};