# class Puppet::DSL::ResourceTypeAPI

Type of the objects inside of which pure ruby manifest files are executed. Provides methods for creating defines, hostclasses, and nodes.

### Public Class Methods

new() click to toggle source

    # File lib/puppet/dsl/resource_type_api.rb, line 7
    def initialize
      @__created_ast_objects__ = []
    end

### Public Instance Methods

define(name, *args, &block) click to toggle source

    # File lib/puppet/dsl/resource_type_api.rb, line 11
    def define(name, *args, &block)
      args = args.inject([]) do |result, item|
        if item.is_a?(Hash)
          item.each { |p, v| result << [p, v] }
        else
          result << item
        end
        result
      end
      @__created_ast_objects__.push Puppet::Parser::AST::Definition.new(name, {:arguments => args}, &block)
      nil
    end

hostclass(name, options = {}, &block) click to toggle source

    # File lib/puppet/dsl/resource_type_api.rb, line 24
    def hostclass(name, options = {}, &block)
      @__created_ast_objects__.push Puppet::Parser::AST::Hostclass.new(name, options, &block)
      nil
    end

node(name, options = {}, &block) click to toggle source

    # File lib/puppet/dsl/resource_type_api.rb, line 29
    def node(name, options = {}, &block)
      name = [name] unless name.is_a?(Array)
      @__created_ast_objects__.push Puppet::Parser::AST::Node.new(name, options, &block)
      nil
    end