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