Module: Chef::DSL::Resources Private

Includes:
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 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.



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

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.



41
42
43
44
# File 'lib/chef/dsl/resources.rb', line 41

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