Skip to content

Instantly share code, notes, and snippets.

@atkolkma
Last active December 22, 2015 23:19
Show Gist options
  • Save atkolkma/6545792 to your computer and use it in GitHub Desktop.
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
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