DBIC/Resource/Role/Set.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 3 totaltotal 86.9% 20 / 23 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
_build_content_types_provided
1.0
to_plain_json
1.0
CRAP 1.0
« DBIC/Resource/Role/Identity.pm ↑ Summary DBIC/Resource/Base.pm »
1 package WebAPI::DBIC::Resource::Role::Set;
2 25 $WebAPI::DBIC::Resource::Role::Set::VERSION = '0.004002';
3  
4 25 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 25 requires 'encode_json';
8 25 requires 'render_item_as_plain_hash';
9  
10  
11 25 has content_types_provided => (
12 is => 'lazy',
13 );
14  
15 74 ▶sub _build_content_types_provided {
Subroutine _build_content_types_provided: called CC=1 SCAR=0.0
16 74 return [ { 'application/vnd.wapid+json' => 'to_plain_json'} ]
17 }
18  
19 16 ▶sub to_plain_json { return $_[0]->encode_json($_[0]->render_set_as_plain($_[0]->set)) }
Subroutine to_plain_json: called CC=1 SCAR=0.0
Pod undocumented
20  
21 69 ▶sub allowed_methods { return [ qw(GET HEAD) ] }
Subroutine allowed_methods: called CC=1 SCAR=0.0
Pod undocumented
22  
23 # Avoid complaints about $set:
24 ## no critic (NamingConventions::ProhibitAmbiguousNames)
25  
26 16 ▶sub render_set_as_plain {
Subroutine render_set_as_plain: called CC=1 SCAR=0.0
Pod undocumented
27 16 my ($self, $set) = @_;
28 16 my $set_data = [ map { $self->render_item_as_plain_hash($_) } $set->all ];
29 16 return $set_data;
30 }
31  
32 25 1;
33  
34 __END__
« DBIC/Resource/Role/Identity.pm ↑ Summary DBIC/Resource/Base.pm »