Class: Chef::Provider::RubyBlock

Inherits:
Chef::Provider show all
Defined in:
lib/chef/provider/ruby_block.rb

Instance Attribute Summary

Attributes inherited from Chef::Provider

#action, #current_resource, #new_resource, #run_context

Instance Method Summary collapse

Methods inherited from Chef::Provider

#action_nothing, #cleanup_after_converge, #cookbook_name, #define_resource_requirements, #events, #initialize, #node, #process_resource_requirements, #requirements, #resource_collection, #run_action, #set_updated_status, #whyrun_mode?

Methods included from DSL::Recipe

#method_missing

Methods included from Mixin::ConvertToClassName

#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename

Constructor Details

This class inherits a constructor from Chef::Provider

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Chef::DSL::Recipe

Instance Method Details

#action_runObject Also known as: action_create



31
32
33
34
35
36
# File 'lib/chef/provider/ruby_block.rb', line 31

def action_run
  converge_by("execute the ruby block #{@new_resource.name}") do 
    @new_resource.block.call
    Chef::Log.info("#{@new_resource} called")
  end
end

#load_current_resourceObject



27
28
29
# File 'lib/chef/provider/ruby_block.rb', line 27

def load_current_resource
  true
end

#whyrun_supported?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/chef/provider/ruby_block.rb', line 23

def whyrun_supported?
  true
end