blib/lib/Acme/Free/API/Ye.pm

filter: Statementstmt 71.4% 20 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 100% 3 / 3 totaltotal 72.5% 29 / 40 CC 1 SCAR 2.9
CC
1
Cov
71%
new
2.0
get
2.0
quote
2.0
CRAP 1.3
↑ Summary
1 package Acme::Free::API::Ye;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '1.0.2';
7  
8 1 ▶use HTTP::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use JSON qw/decode_json/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Util::H2O::More qw/baptise d2o/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 BASEURL => "https://api.kanye.rest",
14 1 };
15  
16 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
17 0 my $pkg = shift;
18 0 my $self = baptise { ua => HTTP::Tiny->new }, $pkg;
19 0 return $self;
20 }
21  
22 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod documented
23 0 my $self = shift;
24 0 my $resp = d2o $self->ua->get(BASEURL);
25 0 return d2o decode_json $resp->content;
26 }
27  
28 0 ▶sub quote {
Subroutine quote: not called CC=1 SCAR=6.9
Pod documented
29 0 my $self = shift;
30 0 return $self->get->quote;
31 }
32  
33 1 1;
34  
35 __END__
↑ Summary