lib/namely/model.rb
def save!
      if persisted?
        update(to_h)
      else
        self.id = resource_gateway.create(to_h)
      end
      self
    rescue RestClient::Exception => e
      raise_failed_request_error(e)
    end
def save!
      if persisted?
        update(to_h)
      else
        self.id = resource_gateway.create(to_h)
      end
      self
    rescue RestClient::Exception => e
      raise_failed_request_error(e)
    end
def save! if persisted? update ( to_h ) else self . id = resource_gateway . create ( to_h ) end self rescue RestClient :: Exception => e raise_failed_request_error ( e ) end
Try to persist the current object to the server by creating a
 new resource or updating an existing one. Raise an error if the
 object can't be saved.

 @raise [FailedRequestError] if the request failed for any reason.

 @return [Model] the model itself, if saving succeeded.
Try to persist the current object to the server by creating a new resource or updating an existing one . Raise an error if the object can t be saved .