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