Sha256: 7fcb241f9a68a4eba3e62e21e4a3b4855fc77856eeec75b76fa051ba232a209e

Contents?: true

Size: 739 Bytes

Versions: 14

Compression:

Stored size: 739 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(scope)
            types = @type.safeevaluate(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

14 entries across 14 versions & 1 rubygems

Version Path
puppet-0.25.5 lib/puppet/parser/ast/tag.rb
puppet-0.25.4 lib/puppet/parser/ast/tag.rb
puppet-0.25.3 lib/puppet/parser/ast/tag.rb
puppet-0.24.9 lib/puppet/parser/ast/tag.rb
puppet-0.25.2 lib/puppet/parser/ast/tag.rb
puppet-0.25.1 lib/puppet/parser/ast/tag.rb
puppet-0.25.0 lib/puppet/parser/ast/tag.rb
puppet-0.24.2 lib/puppet/parser/ast/tag.rb
puppet-0.24.3 lib/puppet/parser/ast/tag.rb
puppet-0.24.4 lib/puppet/parser/ast/tag.rb
puppet-0.24.6 lib/puppet/parser/ast/tag.rb
puppet-0.24.7 lib/puppet/parser/ast/tag.rb
puppet-0.24.5 lib/puppet/parser/ast/tag.rb
puppet-0.24.8 lib/puppet/parser/ast/tag.rb