Module: FizzBuzzer::V2c

Defined in:
lib/fizzbuzzer.rb

Instance Method Summary collapse

Instance Method Details

#fizzbuzzObject



56
57
58
59
60
61
62
63
64
65
# File 'lib/fizzbuzzer.rb', line 56

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