def diff
      diff = {}

      remote = self.class.fetch(id, _prefix) || self.class.new({}, _prefix)
      remote._attributes.each do |key, value|
        unless _attributes[key] == value
          diff[key] = { local: _attributes[key], remote: value }
        end
      end

      diff
    end
def diff
      diff = {}

      remote = self.class.fetch(id, _prefix) || self.class.new({}, _prefix)
      remote._attributes.each do |key, value|
        unless _attributes[key] == value
          diff[key] = { local: _attributes[key], remote: value }
        end
      end

      diff
    end
Calculate a differential of the attributes on the local resource with
 it's remote Chef Server counterpart.

 @example when the local resource is in sync with the remote resource
   bacon = Bacon.first
   bacon.diff #=> {}

 @example when the local resource differs from the remote resource
   bacon = Bacon.first
   bacon.description = "My new description"
   bacon.diff #=> { :description => { :local => "My new description", :remote => "Old description" } }

 @note This is a VERY expensive operation - use it sparringly!

 @return [Hash]