NAME

Redis::LeaderBoard::Member - leader board member of Redis::LeaderBoard

SYNOPSIS

my $leader_board = Redis::LeaderBoard->new(
    redis => $redis,
    key   => 'leader_board:1',
);

# Redis::LeaderBoard::Member object
my $member = $leader_board->find_member('two');
$member->score(90);
my $rank = $member->rank;

DESCRIPTION

Redis::LeaderBoard::Member is member object of Redis::LeaderBoard.

INTERFACE

Methods

$score = $member->score([$score: Number])

set or get score.

$score = $member->incr([$incr_score: Number])

increment score and returns reflected score. 1 is default $increment_score.

$score = $member->decr([$decr_score: Number])

decrement score and returns reflected score. 1 is default $decrement_score.

($rank:Int, $score:Number) = $member->rank_with_score

Returns rank and score.

$rank:Int = $member->rank

Retruns rank.

$order:Int = $member->sorted_order

Get sorted order in sorted set. (same as $redis->zrank)

LICENSE

Copyright (C) Masayuki Matsuki.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Masayuki Matsuki <y.songmu@gmail.com>