class Chef::Resource
Public Class Methods
action(args, &block)
click to toggle source
# File files/lib/compat_resource.rb, line 23 def self.action(args, &block) raise_chef_11_error end
property(args, &block)
click to toggle source
# File files/lib/compat_resource.rb, line 15 def self.property(args, &block) raise_chef_11_error end
raise_chef_11_error()
click to toggle source
# File files/lib/compat_resource.rb, line 27 def self.raise_chef_11_error raise "This resource is written with Chef 12.5 custom resources, and requires at least Chef 12.0 used with the compat_resource cookbook, it will not work with Chef 11.x clients, and those users must pin their cookbooks to older versions or upgrade." end
resource_name(args, &block)
click to toggle source
# File files/lib/compat_resource.rb, line 19 def self.resource_name(args, &block) raise_chef_11_error end
Public Instance Methods
current_value()
click to toggle source
Get the current actual value of this resource.
This does not cache–a new value will be returned each time.
@return A new copy of the resource, with values filled in from the actual
current value.
# File files/lib/chef_compat/monkeypatches/chef/resource.rb, line 14 def current_value provider = provider_for_action(Array(action).first) if provider.whyrun_mode? && !provider.whyrun_supported? raise "Cannot retrieve #{self.class.current_resource} in why-run mode: #{provider} does not support why-run" end provider.load_current_resource provider.current_resource end
resource_initializing=(value)
click to toggle source
# File files/lib/chef_compat/monkeypatches/chef/resource.rb, line 28 def resource_initializing=(value) if value @resource_initializing = value else remove_instance_variable(:@resource_initializing) end end