Module: FizzBuzzer::V6b::FizzBuzz
- Defined in:
- lib/fizzbuzzer.rb
Class Method Summary collapse
Class Method Details
.enumerator ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/fizzbuzzer.rb', line 185 def self.enumerator Enumerator.new do |yielder| (1..100).each do |n| yielder << if n % 3 == 0 && n % 5 == 0 then "FizzBuzz" elsif n % 3 == 0 then "Fizz" elsif n % 5 == 0 then "Buzz" else n end end end end |