line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Notifications::Engine; |
2
|
10
|
|
|
10
|
|
7047
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
10
|
|
|
|
|
36
|
|
|
10
|
|
|
|
|
83
|
|
3
|
10
|
|
|
10
|
|
1683
|
use Scalar::Util qw/blessed/; |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
3565
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Register the plugin - optional |
6
|
|
|
|
7
|
1
|
|
sub register { |
7
|
|
|
|
|
|
|
# Nothing to register - but has to be called |
8
|
|
|
|
|
|
|
}; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# scripts attribute |
12
|
|
|
|
|
|
|
sub scripts { |
13
|
40
|
|
100
|
40
|
1
|
189
|
$_[0]->{scripts} //= []; |
14
|
40
|
100
|
|
|
|
164
|
return @{$_[0]->{scripts}} if @_ == 1; |
|
34
|
|
|
|
|
210
|
|
15
|
6
|
|
|
|
|
15
|
push(@{shift->{scripts}}, @_); |
|
6
|
|
|
|
|
24
|
|
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# styles atttribute |
20
|
|
|
|
|
|
|
sub styles { |
21
|
31
|
|
100
|
31
|
1
|
246
|
$_[0]->{styles} //= []; |
22
|
31
|
100
|
|
|
|
103
|
return @{$_[0]->{styles}} if @_ == 1; |
|
25
|
|
|
|
|
135
|
|
23
|
6
|
|
|
|
|
11
|
push(@{shift->{styles}}, @_); |
|
6
|
|
|
|
|
20
|
|
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# notifications method |
28
|
|
|
|
|
|
|
sub notifications { |
29
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
state $msg = 'No notification engine specified'; |
31
|
0
|
|
|
|
|
|
$self->app->log->error($msg . ' for ' . blessed $self); |
32
|
0
|
|
|
|
|
|
return $msg; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |