woody-decorators 8.3.0 → 9.0.0

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: 5839cb177c6a45740300b91a1bb5730f058062a6
4
- data.tar.gz: 27be0b9b88ac7918f3f0188ac1e7afbcc9524fc1
3
+ metadata.gz: f88a52175e7b6297b007a4364ac14637cc127047
4
+ data.tar.gz: a6f274ff5a071037a8623ac208e52f351ec57708
5
5
  SHA512:
6
- metadata.gz: 3e31f09e9bf794027f6a5f4c280945497f1c005c9a30e66aa5aa34a8050a421d25406da1b9c88c424d38345b2c4e74f1c4172c4b96aa1df0e4fb62b9e7aa80e0
7
- data.tar.gz: 2505d0af48b057fdfb053a75886cc2b7cc999514b3bec952f71cc520d794361c7f14556d07f1ef13fad54f9b2b520d35e715bb483160097d3bc1a58e1f054816
6
+ metadata.gz: 64ad80afa875fe379fb6cd7d98e28bf33e3a95a8cb8318ed55438226d7d4d23aef7d846e23e41789658980eae1fbc88056b51c8e5958fb0fc0dae1b3fb11b46c
7
+ data.tar.gz: f8af226c02b8f14e1d0963c52c7fc1ac66ca71c4acc142166b0837e33612cde4238d5b6dc8b2a6bacb691e4a6ffc1a75c40e8a823e72f56fa364546aaddcb287
@@ -80,12 +80,26 @@ module Woody
80
80
  )
81
81
  end
82
82
 
83
- def reward_total
84
- t = @model.rewards.inject(0) do |total, reward|
83
+ def bonus_rewards
84
+ return @model.rewards.select do |r|
85
+ r.type == 'bonus'
86
+ end.inject(0) do |total, reward|
87
+ total + (reward.quantity * reward.amount)
88
+ end
89
+ end
90
+
91
+ def creator_rewards
92
+ return @model.rewards.select do |r|
93
+ r.type == 'creator'
94
+ end.inject(0) do |total, reward|
95
+ total + (reward.quantity * reward.amount)
96
+ end
97
+ end
98
+
99
+ def total_rewards
100
+ return @model.rewards.inject(0) do |total, reward|
85
101
  total + (reward.quantity * reward.amount)
86
102
  end
87
- return 'SWAG 😎' if t == 0
88
- format('£%d', t)
89
103
  end
90
104
 
91
105
  def status(submission = nil)
@@ -1,5 +1,5 @@
1
1
  module Woody
2
2
  module Decorators
3
- VERSION = '8.3.0'.freeze
3
+ VERSION = '9.0.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woody-decorators
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.0
4
+ version: 9.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-09 00:00:00.000000000 Z
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler