summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/StarGit/Info.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/StarGit/Info.pm b/lib/StarGit/Info.pm
new file mode 100644
index 0000000..589ef01
--- /dev/null
+++ b/lib/StarGit/Info.pm
@@ -0,0 +1,30 @@
+package StarGit::Info;
+
+use Moose;
+
+has login => (
+ isa => 'Str',
+ required => 1,
+ is => 'ro',
+);
+
+with qw(
+ GitHub::Collector::Role::MongoDB
+);
+
+sub get {
+ my $self = shift;
+
+ my $profile = $self->db_profiles->findOne( { login => $self->login } );
+ return undef unless defined $profile;
+
+ return {
+ login => $self->login,
+ name => $profile->{name},
+ email => $profile->{email},
+ website => $profile->{website},
+ gravatar => $profile->{gravatar},
+ };
+}
+
+1;