@publidata/utils-data-manager
Version:
Collection of methods to extract data from publidata
31 lines (25 loc) • 601 B
JavaScript
const PublidataObject = require("../");
/**
* Class representing a sector object.
* @extends PublidataObject
*/
class PublidataObjectSector extends PublidataObject {
get id() {
return this.memoize("id", this.object._id);
}
get name() {
return this.memoize("name", this.object._source.name);
}
get geometry() {
return this.memoize("geometry", this.object._source.geometry);
}
toJSON() {
return {
id: this.id,
name: this.name,
geometry: this.geometry,
source: this.object._source
};
}
}
module.exports = PublidataObjectSector;