gameon-points 0.0.0.pre3 → 0.0.0.pre4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gameon-points/base.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40dda8149d53e94be25d8119865c90c5f9751622
|
4
|
+
data.tar.gz: 0fb51652cb0b416d2473140559745025e2799832
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e87cd039d92d4ef8277e107c35d8ee0b01f009c13e9011bf303c5296aaa81063256a35e529e2c66159f23b92ce0961ff3a44a1349e2f94dfae62c49c954ae827
|
7
|
+
data.tar.gz: d2d7fd1a38318af047d8f381a54ae2405114e8a125f130ba9e3f2b5d98cf2c711768ee7e7b09f15b312eafa08569fc98e4903edb503193d79336e95bdec303a3
|
data/lib/gameon-points/base.rb
CHANGED
@@ -20,14 +20,16 @@ module GameOn
|
|
20
20
|
class Points
|
21
21
|
def initialize(app, opts={},params={})
|
22
22
|
@app = app
|
23
|
+
@opts = opts
|
23
24
|
@params = params
|
24
25
|
end
|
25
26
|
def call(env)
|
26
27
|
if @params.has_key?(:add)
|
27
|
-
env[:gameon].add_points
|
28
|
+
env[:gameon].add_points(@params[:add] * @opts[:inc_by])
|
29
|
+
|
28
30
|
end
|
29
31
|
if @params.has_key?(:remove)
|
30
|
-
env[:gameon].remove_points
|
32
|
+
env[:gameon].remove_points(@params[:remove] * @opts[:dec_by])
|
31
33
|
end
|
32
34
|
@app.call(env) # run the next middleware
|
33
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gameon-points
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.pre4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- theotherstupidguy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gameon
|