gameon-points 0.0.0.pre17 → 0.0.0.pre18
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 +10 -9
- data/lib/gameon-points.rb +2 -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: 77f31643f20ba90644348333d3530e1370de20e4
|
4
|
+
data.tar.gz: 761bef70c3e05b1ed1a78a1e6873b98ae47a05a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 303c4119fb48362f0a98c40f321340a056edc579d19e672982af3303bf2871889af74cdc8b478d9be488a0e0139d3926e0136938dca77af729a0ee0d7ac18972
|
7
|
+
data.tar.gz: 0e41fc5eabbb085e9e437b99509b3dd946cc00e80ce7fef97a2395dccc99d09f0ae0d7f29df0ffda9a83c2aced522cef6d131883973dc8ed1287603f0d9cd5bd
|
data/lib/gameon-points/base.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
GameOn::Env.register do
|
2
2
|
attr_accessor :points
|
3
3
|
def add_points value
|
4
|
-
if
|
5
|
-
@points =
|
6
|
-
else
|
7
|
-
@points
|
4
|
+
if @points.nil?
|
5
|
+
@points = value
|
6
|
+
else
|
7
|
+
@points += value
|
8
8
|
end
|
9
9
|
end
|
10
10
|
def remove_points value
|
11
|
-
if
|
12
|
-
@points =
|
13
|
-
else
|
14
|
-
@points
|
11
|
+
if @points.nil?
|
12
|
+
@points = -(value)
|
13
|
+
else
|
14
|
+
@points += -(value)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -19,12 +19,13 @@ end
|
|
19
19
|
module GameOn
|
20
20
|
class Points
|
21
21
|
include GameOn::Middleware
|
22
|
-
|
22
|
+
|
23
23
|
def initialize(app, opts={},params={})
|
24
24
|
@app = app
|
25
25
|
@opts = opts
|
26
26
|
@params = params
|
27
27
|
end
|
28
|
+
|
28
29
|
def call(env)
|
29
30
|
if !@params.nil? && @params.has_key?(:add)
|
30
31
|
env[:gameon].add_points(@params[:add] * @opts[:inc_by])
|
data/lib/gameon-points.rb
CHANGED
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.pre18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- theotherstupidguy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email:
|