summaryrefslogtreecommitdiff
path: root/lib/GitHub/Collector/Role/SPORE.pm
blob: 079c494f9ee8c933ec6857a3df5c8cdf703d892d (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
package GitHub::Collector::Role::SPORE;

use Moose::Role;
use Net::HTTP::Spore;

has spore_configuration => (
    is            => 'ro',
    isa           => 'HashRef',
    required      => 1,
    documentation => 'SPORE configuration',
);

has spore_client => (
    is => 'rw',
    isa => 'Object',
    lazy => 1,
    default => sub {
        my $self = shift;
        my $client = Net::HTTP::Spore->new_from_spec(
            $self->spore_configuration->{github}->{description},
        );
        $client->enable('Format::JSON');
        $client;
    }
);

1;