tippy-weston 0.1.0 → 0.1.1

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: 9698a8a4e161319dbd78d19138d09a465512de4b9362e061e3ca67fc2ab9260d
4
- data.tar.gz: c0aa5c254d60d3d3ace26ce3dc391a15a14e86742445fb1ef093fa2bab3925ff
3
+ metadata.gz: 2b45406c68a16d3e8eefe0f2b5f82c61c5f0cdf07de56149582c3cef8ee6e0c9
4
+ data.tar.gz: ebcff7c57cb2bbf192ebd04cebaafd18746029dd07fdfbff3e9f892fe1aba0c2
5
5
  SHA512:
6
- metadata.gz: 1f30427114fbda594480d075535a5523761daeb2cef9dfd800ed626b336f48986675acbfa454398e23c785ac534133be9bc4454da712a00e21dfac1dc9b6c348
7
- data.tar.gz: 9fee285d1b48a55b391f966a88ec02ede1b191bd3f6cd9189006161d31802ae43cdb2187c20ddaaccffd417456650f46e49fa278fb472b91b153c37cd450f58f
6
+ metadata.gz: 8c01ba925cdbe8c64a1359e40d6b19b3ab8eabace193ef15853d852ae20927211513c7e312c05a17b83a1b62c87ddaa2cd17ebd45abed55db08c1812b8e6144d
7
+ data.tar.gz: a03c06cce5d288fb472f8219d5378d8f917c35bbaf0e65219fc00efb86d553f1d8d1e2a9a0c30e398c163a39cb905250409be3194f28089adf2670656dc528cc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tippy-weston (0.1.0)
4
+ tippy-weston (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,39 +1,42 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tippy
4
+ module Weston
5
+ # Gotta love Builder
2
6
  class Builder
7
+ def initialize(total:, gratuity:)
8
+ @total = total
9
+ @gratuity = gratuity
10
+ end
3
11
 
4
- def initialize(total:, gratuity:)
5
- @total = total
6
- @gratuity = gratuity
7
- end
12
+ def generate
13
+ return total_accumulator if number_based?
8
14
 
9
- def generate
10
- if number_based?
11
- return total_accumulator
12
- end
13
- string_based
14
- end
15
+ string_based
16
+ end
15
17
 
16
- private
18
+ private
17
19
 
18
- def total_accumulator(gratuity = @gratuity)
19
- @total += @total * ( gratuity.to_f / 100)
20
- end
20
+ def total_accumulator(gratuity = @gratuity)
21
+ @total += @total * (gratuity.to_f / 100)
22
+ end
21
23
 
22
- def number_based?
23
- @gratuity.is_a? Numeric) || (@gratuity.integer?)
24
- end
24
+ def number_based?
25
+ @gratuity.is_a?(Numeric) || @gratuity.integer?
26
+ end
25
27
 
26
- def string_based
27
- case @gratuity.downcase
28
- when 'high'
29
- total_accumulator(25.0)
30
- when 'standard'
31
- total_accumulator(20.0)
32
- when 'low'
33
- total_accumulator(15.0)
34
- else
35
- total_accumulator(20.0)
36
- end
28
+ def string_based
29
+ case @gratuity.downcase
30
+ when "high"
31
+ total_accumulator(25.0)
32
+ when "standard"
33
+ total_accumulator(20.0)
34
+ when "low"
35
+ total_accumulator(15.0)
36
+ else
37
+ total_accumulator(20.0)
37
38
  end
39
+ end
38
40
  end
39
- end
41
+ end
42
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tippy
4
4
  module Weston
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
data/tippy-weston.gemspec CHANGED
@@ -9,16 +9,16 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["51345538+Wcarpenter96@users.noreply.github.com"]
10
10
 
11
11
  spec.summary = "A gem for generating tip values based on a number of inputs."
12
- # spec.description = "TODO: Write a longer description or delete this line."
12
+ # spec.description = "TODO: Write a longer description or delete this line."
13
13
  spec.homepage = "https://github.com/Wcarpenter96/tippy-weston"
14
14
  spec.license = "MIT"
15
15
  spec.required_ruby_version = ">= 2.6.0"
16
16
 
17
- # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
17
+ # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
18
18
 
19
19
  spec.metadata["homepage_uri"] = spec.homepage
20
20
  spec.metadata["source_code_uri"] = "https://github.com/Wcarpenter96/tippy-weston"
21
- # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
21
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tippy-weston
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Weston Carpenter