line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebAPI::DBIC::Resource::HAL::Role::Set; |
2
|
|
|
|
|
|
|
$WebAPI::DBIC::Resource::HAL::Role::Set::VERSION = '0.003002'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
23810116
|
use Moo::Role; |
|
2
|
|
|
|
|
46200
|
|
|
2
|
|
|
|
|
12
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
535
|
use Carp qw(confess); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
406
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
requires '_build_content_types_provided'; |
9
|
|
|
|
|
|
|
requires 'encode_json'; |
10
|
|
|
|
|
|
|
requires 'render_set_as_hal'; |
11
|
|
|
|
|
|
|
requires 'set'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
around '_build_content_types_provided' => sub { |
15
|
|
|
|
|
|
|
my $orig = shift; |
16
|
|
|
|
|
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
my $types = $self->$orig(); |
18
|
|
|
|
|
|
|
unshift @$types, { 'application/hal+json' => 'to_json_as_hal' }; |
19
|
|
|
|
|
|
|
return $types; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
0
|
0
|
|
sub to_json_as_hal { return $_[0]->encode_json($_[0]->render_set_as_hal( $_[0]->set)) } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding UTF-8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
WebAPI::DBIC::Resource::HAL::Role::Set |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 VERSION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
version 0.003002 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 DESCRIPTION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Handles GET and HEAD requests for requests representing set resources, e.g. |
45
|
|
|
|
|
|
|
the rows of a database table. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Supports the C<application/hal+json> content type. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
WebAPI::DBIC::Resource::HAL::Role::Set - add HAL content type support for set resources |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Tim Bunce <Tim.Bunce@pobox.com> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Tim Bunce. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
62
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |