# class Puppet::Parser::AST::Definition

### Attributes

context[RW]

### Public Class Methods

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

    # File lib/puppet/parser/ast/definition.rb, line 6
    def initialize(name, context = {}, &ruby_code)
      @name = name
      @context = context
      @ruby_code = ruby_code
    end

### Public Instance Methods

instantiate(modname) click to toggle source

    # File lib/puppet/parser/ast/definition.rb, line 12
    def instantiate(modname)
      new_definition = Puppet::Resource::Type.new(:definition, @name, @context.merge(:module_name => modname))
      new_definition.ruby_code = @ruby_code if @ruby_code
      [new_definition]
    end