Last active
December 22, 2015 23:19
-
-
Save atkolkma/6545792 to your computer and use it in GitHub Desktop.
Working on step 4 of Fizz Buzz here. But whenever I modify the output of the fizzbuzzer method with the as_text method I get an undefined error
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 FizzBuzz | |
def as_text (input) | |
input.to_string | |
end | |
def fizzbuzzer (limit) | |
(1..limit).map do |n| | |
if n % 15 == 0 | |
"fizzbuzz" | |
elsif n % 5 == 0 | |
"buzz" | |
elsif n % 3 == 0 | |
"fizz" | |
else | |
n | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment