Class: Hiera::RecursiveGuard

### Home Classes Methods

### In Files

- lib/hiera/recursive_guard.rb

### Parent

Object

### Methods

- ::new
- #check

### Class/Module Index

Quicksearch

- Hiera
- Hiera::Backend
- Hiera::Backend::Json_backend
- Hiera::Backend::Yaml_backend
- Hiera::Config
- Hiera::Console_logger
- Hiera::Error
- Hiera::FallbackLogger
- Hiera::Filecache
- Hiera::Interpolate
- Hiera::InterpolationLoop
- Hiera::InvalidConfigurationError
- Hiera::Noop_logger
- Hiera::Puppet_logger
- Hiera::RecursiveGuard
- Hiera::Util

No matching classes.

# Hiera::RecursiveGuard

### Public Class Methods

new() click to toggle source

    # File lib/hiera/recursive_guard.rb, line 7
    def initialize
      @seen = []
    end

### Public Instance Methods

check(value, &block) click to toggle source

    # File lib/hiera/recursive_guard.rb, line 11
    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

[Validate]

Generated with the Darkfish Rdoc Generator 2.