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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gameon-points/base.rb +4 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86f1e422b1547688acc0586697d638c6e4e49aa0
4
- data.tar.gz: 0ca82fcc4af24b6a0bef041fa3255278bfeff0f3
3
+ metadata.gz: 40dda8149d53e94be25d8119865c90c5f9751622
4
+ data.tar.gz: 0fb51652cb0b416d2473140559745025e2799832
5
5
  SHA512:
6
- metadata.gz: d1ea316038b1551dee25c57edb6c5c515fd0e622ec81b5010fb655ddc23516c6ff8e7cfd919cc1673b3ff47dfface0187681158f4366b9400a04274107c40dd4
7
- data.tar.gz: 0991f0277631caf431950d90b8a9ef319339dc788dc48354d2e83ab05cded8ac455a9bf309df446f22d083e01bc66f1b97a90a12bb50d6811afbd05348d28344
6
+ metadata.gz: e87cd039d92d4ef8277e107c35d8ee0b01f009c13e9011bf303c5296aaa81063256a35e529e2c66159f23b92ce0961ff3a44a1349e2f94dfae62c49c954ae827
7
+ data.tar.gz: d2d7fd1a38318af047d8f381a54ae2405114e8a125f130ba9e3f2b5d98cf2c711768ee7e7b09f15b312eafa08569fc98e4903edb503193d79336e95bdec303a3
@@ -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 @params[:add]
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 @params[:remove]
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.pre3
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-12 00:00:00.000000000 Z
11
+ date: 2014-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gameon