woody-decorators 9.1.0 → 10.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: 0bba53feb6d872e9c6e2c147d0b48391f212fb7d
4
- data.tar.gz: 90c717a17f9a72801d03dd98d83e966538afd188
3
+ metadata.gz: 73768b43db8fd9783e670df49d8e2e7a1f0ff848
4
+ data.tar.gz: 07e7ade1292e915c523abf2d98811877c6dbff57
5
5
  SHA512:
6
- metadata.gz: 5d66aeb08131117770029710756895421dd6c8b72602821b5b4e29b460295277769b7ec7c7859646aa34a93ccd00602a916545ee10dfc451ffc3f4a8a946f197
7
- data.tar.gz: e3507859c35e8d69b37fd700294cf5c196596718c6383ae43b7324fbc269906953d76e4e428d9484dcd22e09dc102083a0c0e3312a92736269e2d98031d78bff
6
+ metadata.gz: 7a6dd9e0beb9af8c55df55efdef51e326031e10510e9c7d0458fc75efa2cc35609eaf201dc67f20029cb0ed5a46d2a88b999e18bec36df268242bca8b20a062c
7
+ data.tar.gz: 60e0e2fe9400fe8af13dd9e586d91525bdae8f92d9b0ea284e6f503c5a7d727d1d6d5274b195298397c00dcb575f918d0d33fb996959795557d53599bfe4e9b0
@@ -80,40 +80,33 @@ module Woody
80
80
  )
81
81
  end
82
82
 
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
83
+ def bonus_reward_pool
84
+ r = @model.rewards
85
+ r ? r.bonus_payment_pool : 0
89
86
  end
90
87
 
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
88
+ def creator_seats
89
+ r = @model.rewards
90
+ r ? r.creator_seats : 0
97
91
  end
98
92
 
99
- def total_rewards
100
- return @model.rewards.inject(0) do |total, reward|
101
- total + (reward.quantity * reward.amount)
102
- end
93
+ def expense_reward_pool
94
+ r = @model.rewards
95
+ r ? r.expense_payment_pool : 0
103
96
  end
104
97
 
105
- def creator_seats
106
- r = @model.rewards.find do |r|
107
- r.type == 'creator'
108
- end
109
- r.nil? ? 0 : r.quantity
98
+ def time_reward
99
+ r = @model.rewards
100
+ r ? r.time_payment : 0
110
101
  end
111
102
 
112
- def time_payment
113
- r = @model.rewards.find do |r|
114
- r.type == 'creator'
115
- end
116
- r.nil? ? 0 : r.amount
103
+ def time_reward_pool
104
+ r = @model.rewards
105
+ r ? (r.time_payment * r.creator_seats) : 0
106
+ end
107
+
108
+ def total_reward_pool
109
+ time_reward_pool + bonus_reward_pool
117
110
  end
118
111
 
119
112
  def status(submission = nil)
@@ -1,5 +1,5 @@
1
1
  module Woody
2
2
  module Decorators
3
- VERSION = '9.1.0'.freeze
3
+ VERSION = '10.0.0'.freeze
4
4
  end
5
5
  end
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency "json", "~> 1"
27
27
  spec.add_dependency "time_diff", "~> 0"
28
28
  spec.add_dependency "wes-cloudkit", "~> 4"
29
- spec.add_dependency "wes-data-api", "~> 11"
29
+ spec.add_dependency "wes-data-api", "~> 12"
30
30
  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: 9.1.0
4
+ version: 10.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-12-05 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '11'
131
+ version: '12'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '11'
138
+ version: '12'
139
139
  description:
140
140
  email:
141
141
  - ''