File Coverage

blib/lib/REST/Cot.pm
Criterion Covered Total %
statement 27 27 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 1 0.0
total 35 36 97.2


line stmt bran cond sub pod time code
1             package REST::Cot;
2             $REST::Cot::VERSION = '0.006';
3 1     1   383 use 5.16.0;
  1         2  
4 1     1   3 use strict;
  1         0  
  1         14  
5 1     1   2 use warnings;
  1         1  
  1         17  
6              
7             # ABSTRACT: REST easier, lay on a cot
8              
9              
10 1     1   377 use URI;
  1         2817  
  1         20  
11 1     1   379 use REST::Client;
  1         25683  
  1         27  
12 1     1   330 use REST::Cot::Fragment;
  1         2  
  1         83  
13              
14             sub new {
15 1     1 0 285 my $class = shift;
16 1         2 my $host = shift;
17              
18 1         1 my $ref = {};
19 1         1 $ref->{parent} = undef;
20 1         4 $ref->{client} = REST::Client->new({host => $host, @_});
21 1         3135 $ref->{root} = 1;
22 1     271   4 $ref->{path} = sub { '' };
  271         556  
23              
24 1         3 bless($ref, 'REST::Cot::Fragment');
25              
26 1         2 return $ref;
27             }
28              
29             1;
30              
31             =pod
32              
33             =encoding UTF-8
34              
35             =head1 NAME
36              
37             REST::Cot - REST easier, lay on a cot
38              
39             =head1 VERSION
40              
41             version 0.006
42              
43             =head1 SYNOPSIS
44              
45             This package is a blatant rip-off of Python's Hammock library.
46              
47             my $metacpan = REST::Cot->new('http://api.metacpan.org/');
48             my $data = $metacpan->v0->author->JMMILLS->GET();
49              
50             say $data->{email}->[0]; # jmmills@cpan.org
51              
52             =head1 CAVEAT
53              
54             This package was developed for an application I maintain as conviencince. It's under-documented, and under-tested.
55             YMMV
56              
57             =head1 AUTHOR
58              
59             Jason Mills
60              
61             =head1 COPYRIGHT AND LICENSE
62              
63             This software is copyright (c) 2015 by Jason Mills.
64              
65             This is free software; you can redistribute it and/or modify it under
66             the same terms as the Perl 5 programming language system itself.
67              
68             =cut
69              
70             __END__;