# class Puppet::Parser::AST::Node

### Attributes

context[RW]
names[RW]

### Public Class Methods

new(names, context = {}, &ruby_code) click to toggle source

    # File lib/puppet/parser/ast/node.rb, line 6
    def initialize(names, context = {}, &ruby_code)
      raise ArgumentError, "names should be an array" unless names.is_a? Array
      @names = names
      @context = context
      @ruby_code = ruby_code
    end

### Public Instance Methods

instantiate(modname) click to toggle source

    # File lib/puppet/parser/ast/node.rb, line 13
    def instantiate(modname)
      @names.collect do |name|
        new_node = Puppet::Resource::Type.new(:node, name, @context.merge(:module_name => modname))
        new_node.ruby_code = @ruby_code if @ruby_code
        new_node
      end
    end