fizzbuzz_pro 0.0.4 → 0.0.5
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/lib/fizzbuzz.rb +4 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3861b0dae1126e677fdaf31c716f9ee55f6a72d24b8bb3a812a191f3e7a9b43
|
4
|
+
data.tar.gz: 0a502f440842bef57683840bfed1644e904e40090baef4df8a55a45565ab2aa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 771ee89efab5aa7f3e4fbde50d7292f8b380b40a3bdffdef09dcf309295ea4b3eae9442a2e20925a0040932eee7a994fd865766c652274e92fa096afe4290662
|
7
|
+
data.tar.gz: 6a4c3acf93c6128e5b4ec788744c9138a3d92147c5efa0dd3aade688efa124aed5b63efa0d78a77267614d41be2506faef505e533ae1276c63dbe394834722d9
|
data/lib/fizzbuzz.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
require './error_handling'
|
3
|
+
class Fizzbuzz < ErrorHandling
|
2
4
|
def self.isfizz(*args)
|
3
5
|
if (err_handler(args))
|
4
6
|
low_limit = args[0]
|
@@ -13,18 +15,6 @@ class Fizzbuzz
|
|
13
15
|
puts array.join(",")
|
14
16
|
end
|
15
17
|
end
|
16
|
-
|
17
|
-
def self.err_handler(args)
|
18
|
-
raise "invalid number of arguments " unless args.length == 2
|
19
|
-
low_limit = args[0]
|
20
|
-
up_limit = args[1]
|
21
|
-
unless(low_limit.is_a?(Integer) && up_limit.is_a?(Integer))
|
22
|
-
raise "Enter valid input"
|
23
|
-
end
|
24
|
-
raise "lower limit is greater than upper limit " if low_limit > up_limit
|
25
|
-
true
|
26
|
-
end
|
27
|
-
|
28
18
|
end
|
29
19
|
|
30
|
-
Fizzbuzz.isfizz(3,10
|
20
|
+
Fizzbuzz.isfizz(3,10)
|