Sha256: 3fa4e86f59a45b15d1a05ed58f10bd0533b661e0343692153d9bb28db111d0a3
Contents?: true
Size: 343 Bytes
Versions: 47
Compression:
Stored size: 343 Bytes
Contents
unless Array.method_defined? :cycle require 'backports/tools/arguments' class Array def cycle(n = nil) return to_enum(:cycle, n) unless block_given? if n.nil? each{|e| yield e } until false else n = Backports.coerce_to_int(n) n.times{each{|e| yield e }} end nil end end end
Version data entries
47 entries across 47 versions & 4 rubygems