xsys 0.2.9 → 0.2.10

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: b1fd6c8e4ff443362fdde10e38868c50d74946d6
4
- data.tar.gz: 45f4345b92182a3a8b37b2d573036715aefd71cd
3
+ metadata.gz: 95ecba7c9d99f591384aced77ca921384d481e44
4
+ data.tar.gz: 6f0232471d69495745daa5afa5e482f26c474d18
5
5
  SHA512:
6
- metadata.gz: f9a6efbda1053324ebb3096220296895a3486d2d6afe4a3a9f520f27243bc60ab8620916eff232dd62e5558102285bad35eaf7c47c512c5e2da75be13d6e6a87
7
- data.tar.gz: dcc29e77114061ecb16882aa20e6d0461fa35a3a53578dcf36ad592d20c720eb3e60daa4fd84893d246b736e4b679d8f770ede52723898fc9b70e5c5a0cd2c0e
6
+ metadata.gz: 24287ffa1d88f7c41ee4019bbedac354c04b9020bd297620634f8c838c7260af703e29a1bfc2ca771f3d785a57f036b5aa09024ed8f67bd1fe9ebb990621809e
7
+ data.tar.gz: b00edb95caf93ee6ecbb3c88f34c0c0d5eb621634004578acdce3442acb21d49ecb20e45c39b0461685cab09df382a2db99dfcc2f020ad924886b74355d97ed8
data/CHANGELOG.md CHANGED
@@ -153,3 +153,7 @@
153
153
  ## v0.2.9
154
154
 
155
155
  * Bugfixes
156
+
157
+ ## v0.2.10
158
+
159
+ * Added service and sellable stocks
@@ -27,14 +27,24 @@ module Xsys
27
27
  end
28
28
  end
29
29
 
30
- def sellable_stocks_quantity
30
+ def sellable_stocks
31
31
  stocks.find_all { |s|
32
32
  !['SER', 'EXT'].include?(s.shop_code)
33
- }.map(&:quantity).sum
33
+ }
34
+ end
35
+
36
+ def sellable_stocks_quantity
37
+ sellable_stocks.map(&:quantity).sum
38
+ end
39
+
40
+ def service_stocks
41
+ stocks.find_all { |s|
42
+ ['SER', 'EXT'].include?(s.shop_code)
43
+ }
34
44
  end
35
45
 
36
46
  def service_stocks_quantity
37
- stocks_quantity - sellable_stocks_quantity
47
+ service_stocks.map(&:quantity).sum
38
48
  end
39
49
 
40
50
  def stocks_quantity
data/lib/xsys/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xsys
2
- VERSION = "0.2.9"
2
+ VERSION = "0.2.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xsys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-23 00:00:00.000000000 Z
11
+ date: 2014-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler