summaryrefslogtreecommitdiff
path: root/lib/StarGit/Info.pm
blob: 589ef01d23736d302fbd52da221ac3f38a1c3ba4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;