Created
January 21, 2016 20:16
-
-
Save jaronson/49a951779243beca3c23 to your computer and use it in GitHub Desktop.
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
def get_fizzy_with_it(value) | |
''.tap do |out| | |
is_multiple(value, 3) && out << 'Fizz' | |
is_multiple(value, 5) && out << 'Buzz' | |
end | |
end | |
def is_multiple(value, n) | |
value % n == 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment