leaderboard 3.12.0 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0d3ef8c29d1877020bc95d7a3bad51147aa0eda5
4
- data.tar.gz: bd11c053fcd17988950fee87958303c0186c2ee3
3
+ metadata.gz: 19558a28d4b7285898e103a6942f1d5df5c1dc8c
4
+ data.tar.gz: e8f02004a685670302caa7070f7299cb8d41640d
5
5
  SHA512:
6
- metadata.gz: c9b8be3c741a3af3c79a88901fef4d131c58436e4402f46423709884106ed2b45c07cee7ea4a17895798e9c7fb5ba71e5189fdfcb138a5fc5bd6ea39b52c1312
7
- data.tar.gz: f0d00fc7e09a22e68df13882611bf4599f2d9990552f508e80510176370e1c92b4c02431e634ea97f535fba0c743ec7b626cd8e302d71569c5254329bb6055f2
6
+ metadata.gz: 10d7e059b37014fa0afa7fd154ba0c6275fa84e248fbc0db203fe965a73d0108fa80bdb295a54ef678d8e4245312fdab6bc858fb76fb274ba5e25ab1830afd85
7
+ data.tar.gz: 34e77796159e0325d5ba92ecdc4fa9073785b2f3d84351785f8b64b50f859093ed9ea8b883028f9c0042ae730cdcd2d21928bd4022c33f6257873f0e7ae48736
@@ -1,6 +1,6 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 3.12.0 (2017-02-03)
3
+ ## 3.12.1 (2017-02-03)
4
4
 
5
5
  * Fixed an error with the `ranked_in_list` method when using certain options [#62](https://github.com/agoragames/leaderboard/pull/62)
6
6
  * Added `total_scores` method [#63](https://github.com/agoragames/leaderboard/pull/63)
@@ -373,7 +373,14 @@ class Leaderboard
373
373
  #
374
374
  # @return Sum of scores for all members in leaderboard
375
375
  def total_scores
376
- all_leaders.map{|hash| hash[:score] }.inject(0, :+)
376
+ total_scores_in(@leaderboard_name)
377
+ end
378
+
379
+ # Sum of scores for all members in the named leaderboard
380
+ #
381
+ # @return Sum of scores for all members in named leaderboard
382
+ def total_scores_in(leaderboard_name)
383
+ all_leaders_from(leaderboard_name).map{|hash| hash[:score] }.inject(0, :+)
377
384
  end
378
385
 
379
386
  # Change the score for a member in the leaderboard by a score delta which can be positive or negative.
@@ -1,3 +1,3 @@
1
1
  class Leaderboard
2
- VERSION = '3.12.0'.freeze
2
+ VERSION = '3.12.1'.freeze
3
3
  end
@@ -2,6 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe 'Leaderboard::VERSION' do
4
4
  it 'should be the correct version' do
5
- expect(Leaderboard::VERSION).to eq('3.12.0')
5
+ expect(Leaderboard::VERSION).to eq('3.12.1')
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leaderboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.0
4
+ version: 3.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Czarnecki