How do I compare a registry_value (value in the machine) with the node attribute for every chef-client run if the value keeps changing

The value in the regedit (registry value) keeps changing for every chef client-run. Lets say the default value is default[abc][def] = ‘NULL’ in attributes folder-> default.rb . In the Chef::Recipe “enable.rb” I get the registry_value .

  `first_reg_value = registry_get_values'HKEY_LOCAL_MACHINE\xxx\yy\zzz'
   second_value = node[abc][def]
   first_reg_value.each do |key|
    if key[:name] == 'theoriginal_value' 
    second_value = key[:data]
    only_if { first_reg_value = second_value }
   end 
  end`

How to get the value for every chef-client run from the machine. The value should be changed from NULL to ‘xyz’ and it should reflect in the node attribute value in the chef console.In the next chef-client run if the value changes again the that value should reflect in the node attributes.
Kindly help