Class: Hiera::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/hiera/scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(real) ⇒ Scope

Returns a new instance of Scope.



5
6
7
# File 'lib/hiera/scope.rb', line 5

def initialize(real)
    @real = real
end

Instance Attribute Details

#realObject (readonly)

Returns the value of attribute real.



3
4
5
# File 'lib/hiera/scope.rb', line 3

def real
  @real
end

Instance Method Details

#[](key) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/hiera/scope.rb', line 9

def [](key)
    ans = @real.lookupvar(key)

    # damn you puppet visual basic style variables.
    return nil if ans == ""
    return ans
end

#catalogObject



21
22
23
# File 'lib/hiera/scope.rb', line 21

def catalog
    @real.catalog
end

#compilerObject



29
30
31
# File 'lib/hiera/scope.rb', line 29

def compiler
    @real.compiler
end

#include?(key) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/hiera/scope.rb', line 17

def include?(key)
    @real.lookupvar(key) != ""
end

#resourceObject



25
26
27
# File 'lib/hiera/scope.rb', line 25

def resource
    @real.resource
end