Module: FizzBuzzer::V2b

Defined in:
lib/fizzbuzzer.rb

Instance Method Summary collapse

Instance Method Details

#fizzbuzzObject



44
45
46
47
48
49
50
51
52
# File 'lib/fizzbuzzer.rb', line 44

def fizzbuzz
  (1..100).map do |n|
    if    (n % 15).zero? then "FizzBuzz"
    elsif (n % 3).zero?  then "Fizz"
    elsif (n % 5).zero?  then "Buzz"
    else   n
    end
  end
end