Skip to content

Commit eb55ee3

Browse files
committed
First bit of the User API.
1 parent 56e8e36 commit eb55ee3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

github.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@
3636

3737
Github.User = function(options) {
3838
this.username = options.username;
39-
40-
// TODO: implement
39+
var userPath = "/users/" + options.username;
40+
this.repos = function() {
41+
_request("GET", userPath + "/repos", null, function(err, res) {
42+
cb(err, res);
43+
});
44+
}
4145
};
4246

4347
// Repository API
@@ -174,8 +178,8 @@
174178
return new Github.Repository({name: repo});
175179
};
176180

177-
this.getUser = function() {
178-
return new Github.User({name: repo});
181+
this.getUser = function(user) {
182+
return new Github.User({username: user});
179183
};
180184
};
181185
}).call(this);

0 commit comments

Comments
 (0)