nyros_form 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
  SHA256:
3
- metadata.gz: 1c09881a22afee02cd14bb80112a0ee0d412b138cb0aa9947879a838f460d45e
4
- data.tar.gz: 2e191c996c95312c7b295326412448ac9b64724a4a51f33b2f31420c7565fc89
3
+ metadata.gz: 447b001040ffb17463d6da2a4d80a10fe4ad3d740b81fd536b6912646a57446f
4
+ data.tar.gz: 8f4f666e33217689bf6bea4faa1fade216fa5aabb0d799d4fdff62ee44a86a06
5
5
  SHA512:
6
- metadata.gz: 71c3155b4e54f2e05bb83bc455d2db798302f9bdac4a0af34856ab9f0ae0da949f84df2c91140086793bff1c699f38eeec25247eea5d92bb8cdc8efb0a6c43d6
7
- data.tar.gz: 84072e342f7fd6faf8f8c47ba4974dbf9010ce8468e663981e21ba1d105075d861983b4d1bc1cf9732f31e903d5619e612a36328e44ac6ce0c43f57335092952
6
+ metadata.gz: 926c10d18c713981a432b88da7f04f5472a0370406b989075cbb92428ac4295f258e51ade6c37d6390bd23c849d0fea69d89063c8a2734c1b3c493e7a1ef6cb6
7
+ data.tar.gz: d5b646018efc1cfff45d985067c1da23a2aca90684197bde15b11e644b95ddb411c7a88ef9dc55e7d8ba33d22597b2299ac084fb9c8aca2f2a0451d0daed3a83
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nyros_form (0.1.4)
4
+ nyros_form (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,39 +1,39 @@
1
1
 
2
- # class String
3
- # def integer?
4
- # return true if self =~ /^[1-9]\d*(\.\d+)?$/
5
- # false
6
- # end
7
- # end
2
+ class String
3
+ def integer?
4
+ return true if self =~ /^[1-9]\d*(\.\d+)?$/
5
+ false
6
+ end
7
+ end
8
8
 
9
9
  module NyrosForm
10
10
 
11
11
  class Builder
12
- # def initialize total:, gratuity:
13
- # @total = total
14
- # @gratuity = gratuity
15
- # end
16
-
17
- # def generate
18
- # return calculation if number_based?
19
- # string_based
20
- # end
21
-
22
- # def number_based?
23
- # (@gratuity.is_a? Numeric) || (@gratuity.integer?)
24
- # end
25
-
26
- # def string_based
27
- # case @gratuity.downcase
28
- # when 'high' then calculation 25
29
- # when 'standard' then calculation 18
30
- # when 'low' then calculation 15
31
- # end
32
- # end
33
-
34
- # def calculation gratuity = @gratuity
35
- # @total += @total * (gratuity.to_f / 100)
36
- # end
12
+ def initialize total:, gratuity:
13
+ @total = total
14
+ @gratuity = gratuity
15
+ end
16
+
17
+ def generate
18
+ return calculation if number_based?
19
+ string_based
20
+ end
21
+
22
+ def number_based?
23
+ (@gratuity.is_a? Numeric) || (@gratuity.integer?)
24
+ end
25
+
26
+ def string_based
27
+ case @gratuity.downcase
28
+ when 'high' then calculation 100
29
+ when 'standard' then calculation 200
30
+ when 'low' then calculation 300
31
+ end
32
+ end
33
+
34
+ def calculation gratuity = @gratuity
35
+ @total += @total * (gratuity.to_f / 100)
36
+ end
37
37
  end
38
38
 
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module NyrosForm
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: nyros_form
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
  - raju rekadi