Snooze.pm

filter: Statementstmt 91.6% 11 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 88.2% 15 / 17 CC 1 SCAR 2.2
CC
1
Cov
92%
request
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Snooze/Serialize/JSON.pm ↑ Summary
1 package WWW::Snooze;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.01_02';
7  
8 2 ▶use WWW::Snooze::Request;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub request {
Subroutine request: not called CC=1 SCAR=6.9
Pod documented
11 0 WWW::Snooze::Request->new(@_);
12 }
13  
14 2 1;
15 =head1 NAME
16  
17 WWW::Snooze - Simple RESTful API
18  
19 =head1 SYNOPSIS
20  
21 Using HTTP::Headers to override pieces of the request, REST operations can be
22 performed like so:
23  
24 use WWW::Snooze;
25 use WWW::Snooze::Serialize::JSON;
26 use HTTP::Headers;
27 use Data::Dumper;
28  
29 my $api = WWW::Snooze::request(
30 'https://agilezen.com/api/v1',
31 headers => HTTP::Headers->new(
32 'X-Zen-ApiKey' => 'key'
33 ),
34 serializer => WWW::Snooze::Serialize::JSON->new(
35 extension => ''
36 )
37 );
38  
39 my $tasks = $api->projects(40075)->stories;
40 print Dumper($tasks->get());
41  
42 my $hdr = HTTP::Headers->new();
43 $hdr->authorization_basic('key', '');
44 my $chili = WWW::Snooze::request(
45 'http://chili.example.com',
46 headers => $hdr,
47 );
48 print Dumper($chili->issues(undef, limit => 1)->get());
49  
50 =head1 METHODS
51  
52 =head2 request
53  
54 Returns an instance of L<WWW::Snooze::Request>
55  
56 =head1 AUTHOR
57  
58 Anthony Johnson E<lt>aj@ohess.orgE<gt>
59  
60 =cut
« Snooze/Serialize/JSON.pm ↑ Summary