@publidata/utils-data-manager
Version:
Collection of methods to extract data from publidata
65 lines (52 loc) • 1.39 kB
JavaScript
const PublidataObject = require("../");
/**
* Class representing an elected
* @extends PublidataObject
*/
class PublidataObjectPost extends PublidataObject {
get _source() {
return this.object._source;
}
get id() {
return this.memoize("id", this.object._id);
}
get last_name() {
return this.memoize("last_name", this.object._source.last_name);
}
get first_name() {
return this.memoize("first_name", this.object._source.first_name);
}
get name() {
return this.memoize("name", this.object._source.name);
}
get civility() {
return this.memoize("civility", this.object._source.civility);
}
get contacts() {
return this.memoize("contacts", this.object._source.contacts);
}
get blurb() {
return this.memoize("blurb", this.object._source.blurb);
}
get profile_picture() {
return this.memoize("profile_picture", this.object._source.profile_picture);
}
get socials() {
return this.memoize("socials", this.object._source.socials);
}
toJSON() {
return {
id: this.id,
name: this.name,
blurb: this.blurb,
_source: this._source,
socials: this.socials,
contacts: this.contacts,
civility: this.civility,
last_name: this.last_name,
first_name: this.first_name,
profile_picture: this.profile_picture
};
}
}
module.exports = PublidataObjectPost;