Created
December 29, 2010 20:50
-
-
Save jacegu/759059 to your computer and use it in GitHub Desktop.
FizzBuzz kata solution for "lazy" developers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FizzBuzzGame | |
def answer_for(number) | |
return 'fizzbuzz' if number % 3 == 0 and number % 5 == 0 | |
return 'fizz' if number % 3 == 0 | |
return 'buzz' if number % 5 == 0 | |
number | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment