Module: Chef::DSL::Resources Private

Includes:
ChefProvisioning, Cheffish
Included in:
Recipe
Defined in:
lib/chef/dsl/resources.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Module containing a method for each globally declared Resource

Depends on declare_resource(name, created_at, &block)

Class Method Summary collapse

Methods included from ChefProvisioning

load_chef_provisioning

Methods included from Cheffish

load_cheffish

Class Method Details

.add_resource_dsl(dsl_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



35
36
37
38
39
40
41
# File 'lib/chef/dsl/resources.rb', line 35

def self.add_resource_dsl(dsl_name)
  module_eval(<<-EOM, __FILE__, __LINE__ + 1)
      def #{dsl_name}(args = nil, &block)
        declare_resource(#{dsl_name.inspect}, args, created_at: caller[0], &block)
      end
    EOM
end

.remove_resource_dsl(dsl_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



43
44
45
46
# File 'lib/chef/dsl/resources.rb', line 43

def self.remove_resource_dsl(dsl_name)
  remove_method(dsl_name)
rescue NameError
end