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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc228cbb89eaa288adb7bb917a4e4116a4fb9550
4
- data.tar.gz: 7ebf9d6a467ae49ffe07b0b5ad152bac8b09e41f
3
+ metadata.gz: 77f31643f20ba90644348333d3530e1370de20e4
4
+ data.tar.gz: 761bef70c3e05b1ed1a78a1e6873b98ae47a05a1
5
5
  SHA512:
6
- metadata.gz: 6a87b0b3f517d4c0b629b665f79e8ede91f6241d10bad95a204f873bf6e777506a506320fb3774de856ae6913e0ba82c193965f9a8b3dd45872c49e7e2489bac
7
- data.tar.gz: afc164cce028dae000762e0a1cab7d5c51ea5ba417c250a3fda6e5e3512017909666ea9a18e4a4ea29b222228cebfc7f92db8f4ce9937abd5c0842b2e9123527
6
+ metadata.gz: 303c4119fb48362f0a98c40f321340a056edc579d19e672982af3303bf2871889af74cdc8b478d9be488a0e0139d3926e0136938dca77af729a0ee0d7ac18972
7
+ data.tar.gz: 0e41fc5eabbb085e9e437b99509b3dd946cc00e80ce7fef97a2395dccc99d09f0ae0d7f29df0ffda9a83c2aced522cef6d131883973dc8ed1287603f0d9cd5bd
@@ -1,17 +1,17 @@
1
1
  GameOn::Env.register do
2
2
  attr_accessor :points
3
3
  def add_points value
4
- if !@points.nil?
5
- @points = @points + value
6
- else
7
- @points = 0
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 !@points.nil?
12
- @points = @points - value
13
- else
14
- @points = 0
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
- #def initialize(app, opts= GameOn::Points::Opts, params= GameOn::Points::Params)
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
@@ -1,4 +1,4 @@
1
- #require 'gameon'
2
- #require 'gameon-redis'
1
+ require 'gameon'
2
+ require 'gameon-redis'
3
3
 
4
4
  require 'gameon-points/base'
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.pre17
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-02 00:00:00.000000000 Z
11
+ date: 2014-08-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: