Sha256: 4df453343e0d31d9f921865baffe0e1f914ad059fd77ce6b88cf7ca3eced766f
Contents?: true
Size: 514 Bytes
Versions: 32
Compression:
Stored size: 514 Bytes
Contents
# frozen_string_literal: true module Datadog module Core module Utils # Generates values from a consistent sequence class Sequence def initialize(seed = 0, &block) @seed = seed @current = seed @next_item = block end def next next_item = @next_item ? @next_item.call(@current) : @current @current += 1 next_item end def reset! @current = @seed end end end end end
Version data entries
32 entries across 32 versions & 2 rubygems