Module: FizzBuzzer::V8

Defined in:
lib/fizzbuzzer.rb

Instance Method Summary collapse

Instance Method Details

#fizzbuzzObject



240
241
242
243
244
245
246
247
248
249
# File 'lib/fizzbuzzer.rb', line 240

def fizzbuzz
  (1..100).map do |n|
    case [n % 3 == 0, n % 5 == 0]
    when [true, true]    then "FizzBuzz"
    when [true, false]   then "Fizz"
    when [false, true]   then "Buzz"
    else n
    end
  end
end