Method: Chef::Resource#initialize

Defined in:
lib/chef/resource.rb

#initialize(name, run_context = nil) ⇒ Resource

Returns a new instance of Resource.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/chef/resource.rb', line 101

def initialize(name, run_context=nil)
  @name = name
  @run_context = run_context
  @noop = nil
  @before = nil
  @params = Hash.new
  @provider = nil
  @allowed_actions = [ :nothing ]
  @action = :nothing
  @updated = false
  @updated_by_last_action = false
  @supports = {}
  @ignore_failure = false
  @not_if = nil
  @not_if_args = {}
  @only_if = nil
  @only_if_args = {}
  @immediate_notifications = Array.new
  @delayed_notifications = Array.new
  @source_line = nil
  @retries = 0

  @node = run_context ? deprecated_ivar(run_context.node, :node, :warn) : nil
end