line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Redis::LeaderBoardMulti::Member; |
2
|
|
|
|
|
|
|
|
3
|
12
|
|
|
12
|
|
143
|
use 5.010; |
|
12
|
|
|
|
|
26
|
|
4
|
12
|
|
|
12
|
|
32
|
use strict; |
|
12
|
|
|
|
|
14
|
|
|
12
|
|
|
|
|
162
|
|
5
|
12
|
|
|
12
|
|
35
|
use warnings; |
|
12
|
|
|
|
|
10
|
|
|
12
|
|
|
|
|
2684
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
0
|
|
|
0
|
0
|
|
my ($class, %args) = @_; |
9
|
0
|
|
|
|
|
|
my $self = bless { |
10
|
|
|
|
|
|
|
%args, |
11
|
|
|
|
|
|
|
}, $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
0
|
0
|
|
sub leader_board { shift->{leader_board} } |
15
|
0
|
|
|
0
|
0
|
|
sub member { shift->{member} } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub score { |
18
|
0
|
|
|
0
|
0
|
|
my ($self, $score) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
return $self->leader_board->get_score($self->member) unless $score; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
$self->leader_board->set_score($self->member, $score); |
23
|
0
|
|
|
|
|
|
$score; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub incr { |
27
|
0
|
|
|
0
|
0
|
|
my ($self, $score) = @_; |
28
|
0
|
0
|
|
|
|
|
$score = defined $score ? $score : 1; |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
$self->leader_board->incr_score($self->member, $score); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub decr { |
34
|
0
|
|
|
0
|
0
|
|
my ($self, $score) = @_; |
35
|
0
|
0
|
|
|
|
|
$score = defined $score ? $score : 1; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
$self->leader_board->decr_score($self->member, $score); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub rank_with_score { |
41
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
42
|
0
|
|
|
|
|
|
$self->leader_board->get_rank_with_score($self->member); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub rank { |
46
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
47
|
0
|
|
|
|
|
|
$self->leader_board->get_rank($self->member); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub sorted_order { |
51
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
$self->leader_board->sorted_order($self->member); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |