class ChefCompat::Resource::LWRPBase

Attributes

run_context[RW]

Set the run context on the class. Used to provide access to the node during class definition.

Public Class Methods

actions(*action_names) click to toggle source

Adds action_names to the list of valid actions for this resource. Does not include superclass's action list when appending.

# File files/lib/chef_compat/resource/lwrp_base.rb, line 18
def actions(*action_names)
  action_names = action_names.flatten
  if !action_names.empty? && !@allowed_actions
    self.allowed_actions = ([ :nothing ] + action_names).uniq
  else
    allowed_actions(*action_names)
  end
end
node() click to toggle source
# File files/lib/chef_compat/resource/lwrp_base.rb, line 38
def node
  run_context ? run_context.node : nil
end
valid_actions(*args) click to toggle source

@deprecated

# File files/lib/chef_compat/resource/lwrp_base.rb, line 29
def valid_actions(*args)
  Chef::Log.warn("`valid_actions' is deprecated, please use allowed_actions `instead'!")
  allowed_actions(*args)
end