fizzbuzz_super 0.1.7 → 0.1.8

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fizzbuzz.rb +4 -17
  3. data/lib/main.rb +14 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1db420554d7a6d0eeb2ed0a44481f7a57eb69608f2cf1a496dc6ab332e8d2e32
4
- data.tar.gz: 76a04c23c40b30805dc6be1a82525c3ec648f11a0f14e961ba5f4839dc370ccb
3
+ metadata.gz: 8adf8010804496b2faeb84660dbca80675bb2f0e1e4cf37d2ad8f8e8a2566d35
4
+ data.tar.gz: 1fd196d23bd0f0f704310a853926f33b2082dd35699c41b51c6a7d13b74f85fd
5
5
  SHA512:
6
- metadata.gz: 6b2e712ac3f18439bbeac546a392b853ff15a7f4c80ccbc66b057c887927475bb4b630dd93bcb77c483339f74284fe32507dee5e6754777c919c619dff876a77
7
- data.tar.gz: a07542513d3c94b773779173a1b1e720ddae9a5f52be424923e43c5076206f369e06abf86949326edf8a3bae0a2e6bc7bad125fcb2929258f0d29ef0fc37e297
6
+ metadata.gz: 3f7fc88f0dd3ac5ec478202244c08f8d1eae50409879cd015ddff0d11872ec9da400f6248886acea36710b5d5c2d67abec539756280d5ff7d93b1bcb315a8f50
7
+ data.tar.gz: badfe2ea2bd7018ada3f56f22ba4741b31fffd8ebde12234dfea155f8229323305c08cca282dac514371323c83a3ac321ca73078b7eab3aafa6a2e99d7cac0c7
data/lib/fizzbuzz.rb CHANGED
@@ -1,7 +1,7 @@
1
- require_relative './error_handle'
2
- class FizzBuzz
3
- class << self
4
- def check_fizzbuzz(n)
1
+ # require_relative './error_handle'
2
+ class FizzBuzzCheck
3
+
4
+ def self.check_fizzbuzz(n)
5
5
  if n % 15 == 0
6
6
  "#{n} FizzBuzz"
7
7
  elsif n % 3 == 0
@@ -10,17 +10,4 @@
10
10
  "#{n} Buzz"
11
11
  end
12
12
  end
13
-
14
- def fizzbuzz(*args)
15
- start = args[0]
16
- stop = args[1]
17
- check = ErrorHandle.error_check(*args)
18
-
19
- if check
20
- (start..stop).each do |i|
21
- puts " #{check_fizzbuzz(i)}" unless check_fizzbuzz(i).nil?
22
- end
23
- end
24
- end
25
- end
26
13
  end
data/lib/main.rb CHANGED
@@ -1,2 +1,16 @@
1
1
  require_relative './fizzbuzz'
2
2
  require_relative './error_handle'
3
+ class FizzBuzz
4
+
5
+ def self.fizzbuzz(*args)
6
+ start = args[0]
7
+ stop = args[1]
8
+ check = ErrorHandle.error_check(*args)
9
+ if check
10
+ (start..stop).each do |i|
11
+ puts " #{FizzBuzzCheck.check_fizzbuzz(i)}" unless FizzBuzzCheck.check_fizzbuzz(i).nil?
12
+ end
13
+ end
14
+ end
15
+ end
16
+ FizzBuzz.fizzbuzz(2,5)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fizzbuzz_super
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shrudhin V Raj