line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Notifications::Engine; |
2
|
10
|
|
|
10
|
|
7762
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
10
|
|
|
|
|
36
|
|
|
10
|
|
|
|
|
87
|
|
3
|
10
|
|
|
10
|
|
1809
|
use Scalar::Util qw/blessed/; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
3678
|
|
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
|
186
|
$_[0]->{scripts} //= []; |
14
|
40
|
100
|
|
|
|
133
|
return @{$_[0]->{scripts}} if @_ == 1; |
|
34
|
|
|
|
|
163
|
|
15
|
6
|
|
|
|
|
10
|
push(@{shift->{scripts}}, @_); |
|
6
|
|
|
|
|
21
|
|
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# styles atttribute |
20
|
|
|
|
|
|
|
sub styles { |
21
|
31
|
|
100
|
31
|
1
|
266
|
$_[0]->{styles} //= []; |
22
|
31
|
100
|
|
|
|
102
|
return @{$_[0]->{styles}} if @_ == 1; |
|
25
|
|
|
|
|
132
|
|
23
|
6
|
|
|
|
|
10
|
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__ |