Module: FizzBuzz

Included in:
Array, Range
Defined in:
lib/fizz-buzz.rb

Instance Method Summary collapse

Instance Method Details

#fizzbuzzObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/fizz-buzz.rb', line 2

def fizzbuzz
  return_values = Array.new

  self.each do |n|
    if n.fizzbuzz?
       return_values << "FizzBuzz"
    elsif n.buzz?
      return_values << "Buzz"
    elsif n.fizz?
      return_values << "Fizz"
    else
      return_values << n
    end
  end

  return return_values
end