# File lib/hiera/scope.rb, line 5 def initialize(real) @real = real end
# File lib/hiera/scope.rb, line 9 def [](key) if key == "calling_class" ans = @real.resource.name.to_s.downcase elsif key == "calling_module" ans = @real.resource.name.to_s.downcase.split("::").first else ans = @real.lookupvar(key) end # damn you puppet visual basic style variables. return nil if ans == "" return ans end
# File lib/hiera/scope.rb, line 29 def catalog @real.catalog end
# File lib/hiera/scope.rb, line 37 def compiler @real.compiler end
# File lib/hiera/scope.rb, line 23 def include?(key) return true if ["calling_class", "calling_module"].include?(key) return @real.lookupvar(key) != "" end
# File lib/hiera/scope.rb, line 33 def resource @real.resource end