File Coverage

blib/lib/Articulate/Role/Component.pm
Criterion Covered Total %
statement 17 21 80.9
branch n/a
condition n/a
subroutine 11 15 73.3
pod 12 12 100.0
total 40 48 83.3


line stmt bran cond sub pod time code
1             package Articulate::Role::Component;
2 11     11   4957 use strict;
  11         16  
  11         399  
3 11     11   46 use warnings;
  11         22  
  11         248  
4 11     11   45 use Moo::Role;
  11         18  
  11         66  
5              
6             =head1 NAME
7              
8             Articulate::Role::Component - access the core app and other compnents
9              
10             =cut
11              
12             =head1 DESCRIPTION
13              
14             This role provides accessors so that components can refer to each
15             other. In order to do so they must when created or first called, have
16             their C attribute set.
17              
18             =head1 ATTRIBUTE
19              
20             =head3 app
21              
22             The Articulate app to which this component belongs.
23              
24             =head1 METHODS
25              
26             Each of these methods are simple read-only accessors which use the
27             C attribute to find the relevant component.
28              
29             =head3 augmentation
30              
31             Provides access to the app's augmentation component.
32              
33             =head3 authentication
34              
35             Provides access to the app's authentication component.
36              
37             =head3 authorisation
38              
39             Provides access to the app's authorisation component.
40              
41             =head3 caching
42              
43             Provides access to the app's caching component.
44              
45             =head3 construction
46              
47             Provides access to the app's construction component.
48              
49             =head3 enrichment
50              
51             Provides access to the app's enrichment component.
52              
53             =head3 framework
54              
55             Provides access to the app's framework component.
56              
57             =head3 navigation
58              
59             Provides access to the app's navigation component.
60              
61             =head3 serialisation
62              
63             Provides access to the app's serialisation component.
64              
65             =head3 service
66              
67             Provides access to the app's service component.
68              
69             =head3 storage
70              
71             Provides access to the app's storage component.
72              
73             =head3 validation
74              
75             Provides access to the app's validation component.
76              
77             =cut
78              
79             has app => (
80             is => 'rw',
81             weak_ref => 1,
82             );
83              
84 3     3 1 15 sub augmentation { shift->app->components->{'augmentation'} }
85 0     0 1 0 sub authentication { shift->app->components->{'authentication'} }
86 4     4 1 24 sub authorisation { shift->app->components->{'authorisation'} }
87 5     5 1 21 sub construction { shift->app->components->{'construction'} }
88 2     2 1 12 sub enrichment { shift->app->components->{'enrichment'} }
89 0     0 1 0 sub framework { shift->app->components->{'framework'} }
90 79     79 1 239 sub navigation { shift->app->components->{'navigation'} }
91 0     0 1 0 sub serialisation { shift->app->components->{'serialisation'} }
92 0     0 1 0 sub service { shift->app->components->{'service'} }
93 10     10 1 95 sub storage { shift->app->components->{'storage'} }
94 2     2 1 12 sub validation { shift->app->components->{'validation'} }
95 16     16 1 70 sub caching { shift->app->components->{'caching'} }
96              
97             1;