wunder 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: 1bd1798280b9716dffe6a71fd44054963b94dea4e338ca66562a7516128e551b
4
- data.tar.gz: 4a65757fdf6eecd8c92bc5267ce8133bd41055b1e935d8583ce9cc143aabaf72
3
+ metadata.gz: aa7a0d61dbaa50905e2c82f6f19728f49cadfe10b753f64e76658f1b5f57fe7f
4
+ data.tar.gz: 81d508e6c4a66266505d7380f9e63948150cbe85305bffab6dfc7d9ae9332546
5
5
  SHA512:
6
- metadata.gz: 5cc47386e07edbc650da07fb14ae582f759fb0864e215a51d2f596e592e0c62b0c74a3964232394ed1d1f902962f03cb15a7efe10340a354953eae19f09130f1
7
- data.tar.gz: '0069482f78defc92bbb2afebb762e9dfca497265ea64180aad53edf8ec292f188adbe49f8ccb7f08c1d192b4537beb772f1bcf81b00195872c05c65b9d7252b3'
6
+ metadata.gz: be6c9de276f048b04e1cd5dd23f3a57ef118839077b9082c29fd5c98562ed42ddc4dc85e7815150645efa4c1e7cb30fa7e95d1fbd4fccb9d195d23fb6cb64a55
7
+ data.tar.gz: 52b975a2d67754070c052d5b39b372d89a175c75042b56f396e87578a1d65900803932f95432f091b50978aaf7df3ee7d11c6debdca85127119a68845bb53a75
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wunder (0.1.0)
4
+ wunder (0.1.5)
5
5
  money (~> 6.11)
6
6
  terminal-table (~> 1.8)
7
7
 
@@ -27,6 +27,16 @@ module Promotional
27
27
  end
28
28
  end
29
29
 
30
+ def calculate_total_discounted_price(total, discount_type)
31
+ if discount_type == "percentage"
32
+ discount_price = total - ((total * value) / 100)
33
+ elsif discount_type == "flat_rate"
34
+ discount_price = total
35
+ end
36
+
37
+ discount_price
38
+ end
39
+
30
40
  def validate
31
41
  should_be_present("ItemQuantityPriceRule::Value", value)
32
42
  should_be_a_number("ItemQuantityPriceRule::MinimumQuantity",
@@ -1,3 +1,3 @@
1
1
  module Wunder
2
- VERSION = "0.1.4".freeze
2
+ VERSION = "0.1.5".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wunder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akhilesh