Method: Chef::Resource#load_from

Defined in:
lib/chef/resource.rb

#load_from(resource) ⇒ Object

Make this resource into an exact (shallow) copy of the other resource.



556
557
558
559
560
561
562
# File 'lib/chef/resource.rb', line 556

def load_from(resource)
  resource.instance_variables.each do |iv|
    unless iv == :@source_line || iv == :@action || iv == :@not_if || iv == :@only_if
      instance_variable_set(iv, resource.instance_variable_get(iv))
    end
  end
end