If I were deploying this somewhere, I would lean towards something that looks more like the readable_solution below.

But for the sake of the challenge:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
def solution(number)
 "#{"Fizz" if (number % 3).zero?}#{"Buzz" if (number % 5).zero?}"
end

raise unless solution(3) == "Fizz"
raise unless solution(5) == "Buzz"
raise unless solution(15) == "FizzBuzz"

puts "It works!"

If this were a one-liner competition, I would like my chances. šŸ˜„

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def readable_solution(number)
 modulo_3 = (number % 3).zero?
 modulo_5 = (number % 5).zero?

 if modulo_3 && modulo_5
   "FizzBuzz"
 elsif modulo_3
   "Fizz"
  elsif modulo_5
    "Buzz"
  end
end