Sha256: a10414c5bb0d0025dfd6bc4269d582875e933d17acb10be1bab897d643c7b1a0

Contents?: true

Size: 657 Bytes

Versions: 63

Compression:

Stored size: 657 Bytes

Contents

require 'puppet/parser/ast/branch'

class Puppet::Parser::AST
  # A statement syntactically similar to an ResourceDef, but uses a
  # capitalized object type and cannot have a name.
  class ResourceDefaults < AST::Branch
    attr_accessor :type, :parameters

    associates_doc

    # As opposed to ResourceDef, this stores each default for the given
    # object type.
    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.setdefaults(type, params)
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 4 rubygems

Version Path
puppet-parse-0.1.4 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-parse-0.1.3 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-parse-0.1.2 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-parse-0.1.1 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-2.7.26 lib/puppet/parser/ast/resource_defaults.rb
puppet-2.7.25 lib/puppet/parser/ast/resource_defaults.rb
puppet-2.7.24 lib/puppet/parser/ast/resource_defaults.rb
puppet-2.7.23 lib/puppet/parser/ast/resource_defaults.rb
puppet-2.7.22 lib/puppet/parser/ast/resource_defaults.rb
puppet-parse-0.1.0 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-parse-0.0.6 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-2.7.21 lib/puppet/parser/ast/resource_defaults.rb
puppet-2.6.18 lib/puppet/parser/ast/resource_defaults.rb
puppet-parse-0.0.5 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-parse-0.0.4 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-parse-0.0.2 lib/vendor/puppet/parser/ast/resource_defaults.rb
puppet-2.7.20 lib/puppet/parser/ast/resource_defaults.rb
puppet-2.7.20.rc1 lib/puppet/parser/ast/resource_defaults.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/lib/puppet/parser/ast/resource_defaults.rb
puppet-2.7.19 lib/puppet/parser/ast/resource_defaults.rb