leftronic 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/leftronic.rb +2 -2
- data/lib/leftronic/version.rb +1 -1
- metadata +1 -1
data/lib/leftronic.rb
CHANGED
@@ -40,7 +40,7 @@ class Leftronic
|
|
40
40
|
# Push a new leaderboard
|
41
41
|
# Entries is a hash of the form {:key_name_1 => :value, :key_name_2 => :value}
|
42
42
|
# Sorts by value, and then pushes the top 12
|
43
|
-
def leaderboard(name, entries)
|
43
|
+
def leaderboard(name, entries, &block)
|
44
44
|
values = []
|
45
45
|
|
46
46
|
entries.each do |hash|
|
@@ -53,7 +53,7 @@ class Leftronic
|
|
53
53
|
if b.nil?
|
54
54
|
a
|
55
55
|
else
|
56
|
-
|
56
|
+
b["value"] <=> a["value"]
|
57
57
|
end
|
58
58
|
end[0..11]
|
59
59
|
|
data/lib/leftronic/version.rb
CHANGED