Sha256: 8f891389e2db9faafe0bd0c485b0c5e672d2cbe45bab8b4c40cb59188ab22285

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 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

# $Id: tag.rb 1835 2006-11-08 05:22:24Z luke $

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-0.23.0 lib/puppet/parser/ast/tag.rb
puppet-0.22.4 lib/puppet/parser/ast/tag.rb
puppet-0.23.2 lib/puppet/parser/ast/tag.rb
puppet-0.23.1 lib/puppet/parser/ast/tag.rb