Sha256: 7abe96b0e82e4a4ddbba99b9458c22ba6d18515844f2d429614312650670e9cc

Contents?: true

Size: 782 Bytes

Versions: 2

Compression:

Stored size: 782 Bytes

Contents

require 'puppet/parser/ast/branch'

class Puppet::Parser::AST
    # The code associated with a class.  This is different from components
    # in that each class is a singleton -- only one will exist for a given
    # node.
    class Tag < AST::Branch
        @name = :class
        attr_accessor :type

        def evaluate(hash)
            scope = hash[:scope]

            types = @type.safeevaluate(:scope => scope)

            types = [types] unless types.is_a? Array

            types.each do |type|
                # Now set our class.  We don't have to worry about checking
                # whether we've been evaluated because we're not evaluating
                # any code.
                scope.setclass(self.object_id, type)
            end
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-0.24.0 lib/puppet/parser/ast/tag.rb
puppet-0.24.1 lib/puppet/parser/ast/tag.rb