diff options
Diffstat (limited to '')
| -rw-r--r-- | lib/GitHub/Collector/Role/SPORE.pm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/GitHub/Collector/Role/SPORE.pm b/lib/GitHub/Collector/Role/SPORE.pm new file mode 100644 index 0000000..079c494 --- /dev/null +++ b/lib/GitHub/Collector/Role/SPORE.pm @@ -0,0 +1,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; |
