Agent/HabitRPG.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 29 CC 1 SCAR 6.9
CC
1
Cov
0%
component_name
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Exobrain::Agent::HabitRPG;
2 use Moose::Role;
3 use Method::Signatures;
4  
5 with 'Exobrain::Agent';
6  
7 # ABSTRACT: Roles for to HabitRPG agents
8 our $VERSION = '0.01'; # VERSION
9  
10  
11 sub component_name { "HabitRPG" }
12  
13  
14 has habitrpg => (
15 isa => 'WebService::HabitRPG', is => 'ro', lazy => 1, builder => '_build_habit',
16 );
17  
18 method _build_habit() {
19 my $config = $self->config;
20  
21 my $api_token = $config->{api_token} or die "API token not found";
22 my $user_id = $config->{user_id} or die "User ID not found";
23  
24 # Lazy load our module
25 eval "use WebService::HabitRPG; 1;" or die $@;
26  
27 return WebService::HabitRPG->new(
28 api_token => $api_token,
29 user_id => $user_id,
30 );
31 }
32  
33 1;
34  
35 __END__