line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Toto::Model; |
2
|
4
|
|
|
4
|
|
20
|
use Mojo::Base -base; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
33
|
|
3
|
|
|
|
|
|
|
has 'key'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use overload '""' => sub { |
6
|
6
|
|
|
6
|
|
605
|
shift->key; |
7
|
4
|
|
|
4
|
|
728
|
}; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
43
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub autocomplete { |
10
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
11
|
0
|
|
|
|
|
|
my %args = @_; |
12
|
0
|
0
|
|
|
|
|
my $q = $args{q} or return; |
13
|
0
|
|
|
|
|
|
my $object = $args{object}; |
14
|
0
|
|
|
|
|
|
my $c = $args{c}; |
15
|
0
|
|
0
|
|
|
|
my $tab = $args{tab} || 'default'; |
16
|
|
|
|
|
|
|
return [ |
17
|
0
|
|
|
|
|
|
map +{ |
18
|
|
|
|
|
|
|
name => "$object $_", |
19
|
|
|
|
|
|
|
href => $c->url_for("$object/$tab", key => $_), |
20
|
|
|
|
|
|
|
}, 1..10 |
21
|
|
|
|
|
|
|
]; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|