Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Base = require('models/base.js');
- var User = module.exports = function(data) {
- data = data || {};
- this.fname = data.fname || '';
- this.lname = data.lname || '';
- this.email = data.email || '';
- };
- /**
- * Takes a response from FB and convert it to object
- */
- User.prototype.importFacebookData = function(result) {
- this.fname = result.first_name || '';
- this.lname = result.last_name || '';
- this.name = result.name || this.fname + ' ' + this.lname || '';
- this.email = result.email || '';
- };
- var Base = module.exports = function() {
- };
- Base.prototype.save = function() {
- // Some code for saving to DB
- };
- User.prototype = new Base();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement