cash_register 0.1.1 → 0.1.2

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: 0b6e16af5305bd7b90f3dce3eab1641d4b499a48
4
- data.tar.gz: b8593e873e1e91fd160590e731daa64fc307070d
3
+ metadata.gz: 3a4744d93e1d16cd07ab61f60f62114d07017061
4
+ data.tar.gz: dd33f6a425548922830a310dba18872cd18ba456
5
5
  SHA512:
6
- metadata.gz: d283e22982a79dede3e124b965e52484006fc783b18ad66b888bdd60d1d41966e8ce45bcffa995557354ba5521f8e91dcb04edcd9fed74f4d3f6a077ee026f17
7
- data.tar.gz: d7d9695fd22acdb2aa341570ed94c23dfe640917fe56ff8f7f65c49d408a45c707f0adc8d7657caa37b1239b6353bee2fa1e6e6492cdf7ba5ef498c15f97124a
6
+ metadata.gz: 209a32e2b19a1a3ba28dcd7a95d72cb7eb9e3f686abf9ec779b2b21bc0ba032264ede494f8b57baf80cd16385c9abed636d2c56df4ea726b91db5b2b10fcecce
7
+ data.tar.gz: 34a53f46108707a4665f0dd9ee6a23835524f9b3dff3f61a287560f3ad2bca27b387d26d52bccd426aaabe25f87b62e5e00a3696fe155336bbb33dc7e124198c
@@ -14,9 +14,11 @@ module CashRegister
14
14
  end
15
15
 
16
16
  def find_by_code(code = '')
17
- deal = @deals[code]
18
- raise InvalidDealError if deal.nil?
19
- deal
17
+ begin
18
+ deal = @deals[code]
19
+ rescue
20
+ raise InvalidDealError if deal.nil?
21
+ end
20
22
  end
21
23
  end
22
24
  end
@@ -11,11 +11,11 @@ module CashRegister
11
11
  end
12
12
 
13
13
  def is_two_for_one?(code = '')
14
- (@promotions['TWO_FOR_ONE_FREE'] || []).include?(code)
14
+ (@promotions['TWO_FOR_ONE_FREE'] rescue []).include?(code)
15
15
  end
16
16
 
17
17
  def is_discount?(code = '')
18
- (@promotions['DISCOUNT'] || []).include?(code)
18
+ (@promotions['DISCOUNT'] rescue []).include?(code)
19
19
  end
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cash_register
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clark King