line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Notifications::Engine; |
2
|
10
|
|
|
10
|
|
7300
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
10
|
|
|
|
|
32
|
|
|
10
|
|
|
|
|
81
|
|
3
|
10
|
|
|
10
|
|
1828
|
use Scalar::Util qw/blessed/; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
3311
|
|
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
|
184
|
$_[0]->{scripts} //= []; |
14
|
40
|
100
|
|
|
|
109
|
return @{$_[0]->{scripts}} if @_ == 1; |
|
34
|
|
|
|
|
149
|
|
15
|
6
|
|
|
|
|
10
|
push(@{shift->{scripts}}, @_); |
|
6
|
|
|
|
|
21
|
|
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# styles atttribute |
20
|
|
|
|
|
|
|
sub styles { |
21
|
31
|
|
100
|
31
|
1
|
259
|
$_[0]->{styles} //= []; |
22
|
31
|
100
|
|
|
|
104
|
return @{$_[0]->{styles}} if @_ == 1; |
|
25
|
|
|
|
|
126
|
|
23
|
6
|
|
|
|
|
12
|
push(@{shift->{styles}}, @_); |
|
6
|
|
|
|
|
16
|
|
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__ |