fizzbuzz_super 0.0.7

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 (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/fizzbuzz.rb +26 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b0f33bd559ac0c06e43f2a7c76deed767a74402828280b53187ccaad5511a92c
4
+ data.tar.gz: 6f1ed02391abd07740f1934c370be475110235d24d9bb0950d914328a18a2cc4
5
+ SHA512:
6
+ metadata.gz: 8744f62359f8b938e37e4d3ded5067736fe64ed8dd8e63b4653d234b3fa38a642f8dfe50410a98560f26803b80d8d3f207564062fb83f2e8367958bfb7fd03d2
7
+ data.tar.gz: d6bc4aade89523b18e18aefedc5a6c5d3143f1947ff09646e73b564388594e86532e30b7c857dc87ca2ed9bc521acdfbd56afecb0517d6834c857c65b4905db5
data/lib/fizzbuzz.rb ADDED
@@ -0,0 +1,26 @@
1
+
2
+ module FizzBuzz
3
+ def self.check_fizzbuzz(n)
4
+ if n % 15 == 0
5
+ "#{n} FizzBuzz"
6
+ elsif n % 3 == 0
7
+ "#{n} Fizz"
8
+ elsif n % 5 == 0
9
+ "#{n} Buzz"
10
+ end
11
+ end
12
+
13
+ def self.fizzbuzz(*args)
14
+ start = args[0]
15
+ stop = args[1]
16
+ check = !start.nil? && !stop.nil? && (start < stop)
17
+ if check
18
+
19
+ (start..stop).each do |i|
20
+ puts " #{check_fizzbuzz(i)}" unless check_fizzbuzz(i).nil?
21
+ end
22
+ else
23
+ puts 'Invalid Data'
24
+ end
25
+ end
26
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fizzbuzz_super
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
5
+ platform: ruby
6
+ authors:
7
+ - Shrudhin V Raj
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-12-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple FizzBuzz gem for Developers
14
+ email: shrudhin@foradian.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/fizzbuzz.rb
20
+ homepage: https://rubygems.org/gems/fizzbuzz_super
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.0.6
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: Fizz_Buzz_Super
43
+ test_files: []