class Puppet::Parser::AST::ResourceDefaults

A statement syntactically similar to an ResourceDef, but uses a capitalized object type and cannot have a name.

Attributes

parameters[RW]
type[RW]

Public Instance Methods

evaluate(scope) click to toggle source

As opposed to ResourceDef, this stores each default for the given object type.

# File lib/puppet/parser/ast/resource_defaults.rb, line 13
def evaluate(scope)
  # Use a resource reference to canonize the type
  ref = Puppet::Resource.new(@type, "whatever")
  type = ref.type
  params = @parameters.safeevaluate(scope)

  parsewrap do
    scope.define_settings(type, params)
  end
end