Sha256: 4563ffaf1e732296bb63d7841f3fc2e0890f0ed7918e24d2531f143750ec6bf6
Contents?: true
Size: 420 Bytes
Versions: 21
Compression:
Stored size: 420 Bytes
Contents
# Allow for safe recursive lookup of values during variable interpolation. # # @api private class Hiera::InterpolationLoop < StandardError; end class Hiera::RecursiveGuard def initialize @seen = [] end def check(value, &block) if @seen.include?(value) raise Hiera::InterpolationLoop, "Detected in [#{@seen.join(', ')}]" end @seen.push(value) ret = yield @seen.pop ret end end
Version data entries
21 entries across 21 versions & 1 rubygems