nyros_form 0.1.3 → 0.1.4
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 +4 -4
- data/app/helpers/time_ago_helper.rb +0 -0
- data/lib/nyros_form/builder.rb +21 -23
- data/lib/nyros_form/version.rb +1 -1
- data/vendor/assets/javascripts/jquery.time_ago.js +0 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 025a27ccf90bacd750e52d9066dfb7d81c81458fca22fdf49814f89c17816e3a
|
4
|
+
data.tar.gz: edb357856e61565279a8884aacaabbe4373d333eeb3620b8003e9811ccd13efb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4b6dfe7e7a15beda690728e34061eb9d6b830e576972eaf1052449f5885f143976245336d32b39de1a3e1f32ebf61f43431ff3b7eceb6b4e39a7fbe44044d0c
|
7
|
+
data.tar.gz: 38c3f93254e71fd8f6a44dbfa14f749fd0c28ee2387876a9a003733d59148d2a401a553b225159dc237274da0b5d25fbef5412e2179d59f510a8cd46c270db54
|
File without changes
|
data/lib/nyros_form/builder.rb
CHANGED
@@ -8,34 +8,32 @@ end
|
|
8
8
|
|
9
9
|
module NyrosForm
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
class Builder
|
12
|
+
def initialize total:, gratuity:
|
13
|
+
@total = total
|
14
|
+
@gratuity = gratuity
|
15
|
+
end
|
16
16
|
|
17
17
|
def generate
|
18
|
-
|
18
|
+
return calculation if number_based?
|
19
|
+
string_based
|
19
20
|
end
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
# def string_based
|
26
|
-
# case @gratuity.downcase
|
27
|
-
# when 'high' then calculation 100
|
28
|
-
# when 'standard' then calculation 50
|
29
|
-
# when 'low' then calculation 25
|
30
|
-
# end
|
31
|
-
# end
|
32
|
-
|
33
|
-
# def calculation gratuity = @gratuity
|
34
|
-
# @total += @total * (gratuity.to_f / 100)
|
35
|
-
# end
|
36
|
-
# end
|
37
|
-
|
22
|
+
def number_based?
|
23
|
+
(@gratuity.is_a? Numeric) || (@gratuity.integer?)
|
24
|
+
end
|
38
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
|
39
33
|
|
34
|
+
def calculation gratuity = @gratuity
|
35
|
+
@total += @total * (gratuity.to_f / 100)
|
36
|
+
end
|
37
|
+
end
|
40
38
|
|
41
39
|
end
|
data/lib/nyros_form/version.rb
CHANGED
File without changes
|
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.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- raju rekadi
|
@@ -66,12 +66,14 @@ files:
|
|
66
66
|
- Gemfile.lock
|
67
67
|
- README.md
|
68
68
|
- Rakefile
|
69
|
+
- app/helpers/time_ago_helper.rb
|
69
70
|
- bin/console
|
70
71
|
- bin/setup
|
71
72
|
- lib/nyros_form.rb
|
72
73
|
- lib/nyros_form/builder.rb
|
73
74
|
- lib/nyros_form/version.rb
|
74
75
|
- nyros_form.gemspec
|
76
|
+
- vendor/assets/javascripts/jquery.time_ago.js
|
75
77
|
homepage: https://github.com/nraju-nyros/nyros_form
|
76
78
|
licenses: []
|
77
79
|
metadata: {}
|