Sha256: cfded2a0f92e3a36723e19507866bf5bb3db29512e65ea85835ac2824b0d2973

Contents?: true

Size: 260 Bytes

Versions: 2

Compression:

Stored size: 260 Bytes

Contents

class Fizzbuzzer < ActiveRecord::Base
  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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
virtual_keywords-0.3.1 lib/spec/virtualizees/fizzbuzzer.rb
virtual_keywords-0.3.0 lib/spec/virtualizees/fizzbuzzer.rb