{"size": 1027, "ext": "js", "max_stars_repo_path": "node_modules/node-uber/lib/resources/User.js", "max_stars_repo_name": "princelynirmal/fmf", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "node_modules/node-uber/lib/resources/User.js", "max_issues_repo_name": "princelynirmal/fmf", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/node-uber/lib/resources/User.js", "max_forks_repo_name": "princelynirmal/fmf", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.3428571429, "max_line_length": 95, "alphanum_fraction": 0.6699123661}
function User(uber) {
  this._uber = uber;
  this.path = ['me', 'history'];

  // deprecated
  this.activity = this._uber.deprecateMethod(function activity(query, access_token, callback) {
    if(!query) {
      query = { offset: null, limit: null };
    }
    return this.getHistory(query.offset, query.limit, callback);
  }, 'user.activity', 'user.getHistory');

  this.profile = this._uber.deprecateMethod(function profile(access_token, callback) {
    return this.getProfile(callback);
  }, 'user.profile', 'user.getProfile');
}

module.exports = User;

User.prototype.getHistory = function getHistory(off, lim, callback) {
  var newOffset = off || 0;
  // ensure query limit is set. Maximum is 50. Default is 5.
  var newLimit = (lim) ? Math.min(lim, 50) : 5;

  return this._uber.get({
    url: this.path[1],
    version: 'v1.2',
    params: { offset: newOffset, limit: newLimit }
  }, callback);
};

User.prototype.getProfile = function getProfile(callback) {
  return this._uber.get({ url: this.path[0]}, callback);
};
