Document/Role/Attributes.pm

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 7 / 7 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« Document/Builder/Role/Parameters.pm ↑ Summary
1 package JSONAPI::Document::Role::Attributes;
2 1 $JSONAPI::Document::Role::Attributes::VERSION = '2.0';
3 =head1 NAME
4  
5 JSONAPI::Document::Role::Attributes - Consumable role to build resource attributes
6  
7 =head1 VERSION
8  
9 version 2.0
10  
11 =head1 DESCRIPTION
12  
13 This role allows you to customize the fetching of a rows attributes.
14  
15 Simply add this to the row object and implement the C<attributes> method and it'll
16 be called instead of C<JSONAPI::Document> doing the building of attributes.
17  
18 The method is passed a single argument, an C<ArrayRef> of requested fields,
19 which should be honoured in the returned C<HashRef>.
20  
21 =head2 attributes(ArrayRef $fields?) : HashRef
22  
23 Returns a hashref of columns/attributes for the consuming classes row.
24  
25 =cut
26  
27 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 1 requires 'attributes';
30  
31 1 1;
« Document/Builder/Role/Parameters.pm ↑ Summary