Sha256: e9527d6f7c4ff62c2073aa2eb76518c48617529686b50bf6335b5e62322ba2f7
Contents?: true
Size: 508 Bytes
Versions: 395
Compression:
Stored size: 508 Bytes
Contents
module BookKeeping VERSION = 3 end class Raindrops def self.convert(i) new(i).convert end attr_reader :number def initialize(number) @number = number end def convert unless pling? || plang? || plong? return number.to_s end s = '' s << 'Pling' if pling? s << 'Plang' if plang? s << 'Plong' if plong? s end private def pling? (number % 3) == 0 end def plang? (number % 5) == 0 end def plong? (number % 7) == 0 end end
Version data entries
395 entries across 395 versions & 1 rubygems