Class: Fizzbuzzer
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Fizzbuzzer
- Defined in:
- lib/spec/virtualizees/fizzbuzzer.rb
Instance Method Summary collapse
Instance Method Details
#fizzbuzz(n) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/spec/virtualizees/fizzbuzzer.rb', line 2 def fizzbuzz(n) (1..n).map { |i| if i % 3 == 0 and i % 5 == 0 "fizzbuzz" elsif i % 3 == 0 "fizz" elsif i % 5 == 0 "buzz" else i.to_s end } end |