Class: Fixnum
- Inherits:
-
Object
- Object
- Fixnum
- Defined in:
- lib/fizzbuzzer.rb
Overview
monkey patch for Fixnum - note: use refinements (in the future) - why? why not?
Instance Method Summary collapse
Instance Method Details
#to_fizzbuzz ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/fizzbuzzer.rb', line 83 def to_fizzbuzz if self % 3 == 0 && self % 5 == 0 "FizzBuzz" elsif self % 3 == 0 "Fizz" elsif self % 5 == 0 "Buzz" else self end end |