tippy_mun 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4dd096b2a130c0d425a2e008f02a8ff00cc923f
4
- data.tar.gz: 894b2bebdff0b1ae07aed9277d03428c9af79228
3
+ metadata.gz: 13a0cc101e3663b44603f1085e46cf961e90635b
4
+ data.tar.gz: 30c6ab5da1f4c9c2b2b971ce190302f0986b135e
5
5
  SHA512:
6
- metadata.gz: 30d91cbcf6098cc92fbc324ba18ea97cf922e4646e0a4120ef8aba777f4d31c4dad06888263cefbd50f11c4152b54d18fcb7fbef5b41510e194c2cc494864537
7
- data.tar.gz: e715d1dbede378a26d89d8129ff34cf1d0f07c16b4ee1eab4183eda50bffb4b8cb2843e823cc57c09e72093e3d8d2037f3f9623e8d5f24cfaaea488104ac3c2f
6
+ metadata.gz: a402264573bf39868cdc3c1e88cc23dfff399314348e20a5b99d79981db6f7164062a117f3770b6ba05927de51888127c439048f8627488c33a3883ab6b1fc17
7
+ data.tar.gz: b368023e0c407cff24308860d7256b585779fd2756cfeeb9a882b3e93f517ee48761eaa3ff4599fad029516259e99dfc196c5e3e40e503c8114a88a4a1f105c9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tippy_mun (0.1.5)
4
+ tippy_mun (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,36 +1,38 @@
1
1
  class String
2
- def integer?
3
- return true if self =~ /^[1-9]\d*(\.\d+)?$/
4
- false
5
- end
2
+ def integer?
3
+ return true if self =~ /^[1-9]\d*(\.\d+)?$/
4
+ false
5
+ end
6
6
  end
7
7
 
8
- module TippyMun
9
- class Builder
10
- def initialize (total, gratuity)
11
- @total = total
12
- @gratuity = gratuity
13
- end
14
-
15
- def generate
16
- return calculation if number_based?
17
- string_based
18
- end
8
+ module Tippy
19
9
 
20
- def number_based?
21
- (@gratuity.is_a? Numeric) || (@gratuity.integer?)
22
- end
10
+ class Builder
11
+ def initialize total:, gratuity:
12
+ @total = total
13
+ @gratuity = gratuity
14
+ end
23
15
 
24
- def string_based
25
- case @gratuity.downcase
26
- when 'high' then calculation 25
27
- when 'standard' then calculation 18
28
- when 'low' then calculation 15
29
- end
30
- end
16
+ def generate
17
+ return calculation if number_based?
18
+ string_based
19
+ end
20
+
21
+ def number_based?
22
+ (@gratuity.is_a? Numeric) || (@gratuity.integer?)
23
+ end
24
+
25
+ def string_based
26
+ case @gratuity.downcase
27
+ when 'high' then calculation 25
28
+ when 'standard' then calculation 18
29
+ when 'low' then calculation 15
30
+ end
31
+ end
32
+
33
+ def calculation gratuity = @gratuity
34
+ @total += @total * (gratuity.to_f / 100)
35
+ end
36
+ end
31
37
 
32
- def calculation gratuity = @gratuity
33
- @total += @total * (gratuity.to_f / 100)
34
- end
35
- end
36
38
  end
@@ -1,3 +1,3 @@
1
1
  module TippyMun
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tippy_mun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Munir