summaryrefslogtreecommitdiff
path: root/lib/github/representation/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/github/representation/user.rb')
-rw-r--r--lib/github/representation/user.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/github/representation/user.rb b/lib/github/representation/user.rb
new file mode 100644
index 00000000000..18591380e25
--- /dev/null
+++ b/lib/github/representation/user.rb
@@ -0,0 +1,15 @@
+module Github
+ module Representation
+ class User < Representation::Base
+ def email
+ return @email if defined?(@email)
+
+ @email = Github::User.new(username, options).get.fetch('email', nil)
+ end
+
+ def username
+ raw['login']
+ end
+ end
+ end
+end