Advertisement
ZaBlanc

Kata 8/22 Fizz Buzz

Aug 22nd, 2011
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.22 KB | None | 0 0
  1. class FizzBuzz
  2.   def self.fizz(num)
  3.     case
  4.       when num % 15 == 0
  5.         "FizzBuzz"
  6.       when num % 3 == 0
  7.         "Fizz"
  8.       when num % 5 == 0
  9.         "Buzz"
  10.       else
  11.         num.to_s
  12.     end
  13.   end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement