Skip to content

Commit

Permalink
Merge 1794ca5 into 9098f7d
Browse files Browse the repository at this point in the history
  • Loading branch information
Gela committed Apr 15, 2015
2 parents 9098f7d + 1794ca5 commit 82b0fab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/model/nodes/person.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var util = require('util'),
utility = require('../../util'),
crypto = require('crypto'),
DynamicNode = require('./dynamic').DynamicNode,

/**
Expand All @@ -12,6 +13,7 @@ var util = require('util'),
PersonNode = function (parent, key, person) {
this
.setTitle(person)
.getEmail(person)
.processRoute(parent, {
conditions: {
id: key
Expand All @@ -35,6 +37,19 @@ PersonNode.prototype.setTitle = function (person) {
return this;
};

/**
* Gets email for node
* @param {Object} person - object data for person
* @returns {PersonNode}
*/
PersonNode.prototype.getEmail = function (person) {
this.email = utility.getLanguages().reduce(function (prev, lang) {
prev[lang] = util.format('%s', person[lang]['email']);
return prev;
}, {});
return this;
};

/**
* Sets view for node
* @returns {PersonNode}
Expand Down

0 comments on commit 82b0fab

Please sign in to comment.