def save!
      validate!

      response = if new_resource?
                   self.class.post(to_json, _prefix)
                 else
                   self.class.put(id, to_json, _prefix)
                 end

      # Update our local copy with any partial information that was returned
      # from the server, ignoring an "bad" attributes that aren't defined in
      # our schema.
      response.each do |key, value|
        update_attribute(key, value) if attribute?(key)
      end

      true
    end
def save!
      validate!

      response = if new_resource?
                   self.class.post(to_json, _prefix)
                 else
                   self.class.put(id, to_json, _prefix)
                 end

      # Update our local copy with any partial information that was returned
      # from the server, ignoring an "bad" attributes that aren't defined in
      # our schema.
      response.each do |key, value|
        update_attribute(key, value) if attribute?(key)
      end

      true
    end
Commit the resource and any changes to the remote Chef Server. Any errors
 will raise an exception in the main thread and the resource will not be
 committed back to the Chef Server.

 Any response errors (such as server-side responses) that ChefAPI failed
 to account for in validations will also raise an exception.

 @return [Boolean]
   true if the resource was saved