Skip to content

Instantly share code, notes, and snippets.

@czarneckid
Created January 23, 2011 18:03
Show Gist options
  • Save czarneckid/792283 to your computer and use it in GitHub Desktop.
Save czarneckid/792283 to your computer and use it in GitHub Desktop.
Scenario 3
ruby-1.8.7-p302 > total_money_lb = Leaderboard.new('total_money')
=> #<Leaderboard:0x101180680 @leaderboard_name="total_money", @page_size=25, @port=6379, @redis_connection=#<Redis client v2.1.1 connected to redis://localhost:6379/0 (Redis v2.0.4)>, @host="localhost", @redis_options={:host=>"localhost", :port=>6379}>
ruby-1.8.7-p302 > total_money_lb.change_score_for('DavidCzarnecki', 15)
=> "15"
ruby-1.8.7-p302 > total_money_lb.change_score_for('ChristianArca', 7)
=> "7"
ruby-1.8.7-p302 > total_money_lb.leaders(1)
=> [{:member=>"DavidCzarnecki", :score=>"15", :rank=>1}, {:member=>"ChristianArca", :score=>"7", :rank=>2}]
ruby-1.8.7-p302 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment