lib/intercom/user.rb in intercom-0.0.6 vs lib/intercom/user.rb in intercom-0.0.7
- old
+ new
@@ -80,9 +80,22 @@
# @return [UserCollectionProxy]
def self.all
UserCollectionProxy.new
end
+ # Deletes a user record on your application.
+ #
+ # Calls DELETE https://api.intercom.io/v1/users
+ #
+ # returns Intercom::User object representing the user just before deletion.
+ #
+ # This operation is not idempotent.
+ # @return [User]
+ def self.delete(params)
+ response = Intercom.delete("users", params)
+ User.from_api(response)
+ end
+
# instance method alternative to #create
# @return [User]
def save
response = Intercom.post("users", to_hash)
self.update_from_api_response(response)