module FizzBuzzer::V11a
Public Instance Methods
fizzbuzz()
click to toggle source
# File lib/fizzbuzzer.rb, line 297 def fizzbuzz result = [] for n in 1..100 do result << if n % 3 == 0 && n % 5 == 0 then "FizzBuzz" elsif n % 3 == 0 then "Fizz" elsif n % 5 == 0 then "Buzz" else n end end result end