Advertisement
ZaBlanc

Kata 8/24 Fizz Buzz w/ RSpec

Aug 24th, 2011
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.17 KB | None | 0 0
  1. class FizzBuzz
  2.   def fizz(num)
  3.     return "FizzBuzz" if num % 15 == 0
  4.     return "Fizz" if num % 3 == 0
  5.     return "Buzz" if num % 5 == 0
  6.     return num.to_s
  7.   end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement