Sha256: d8e433835c110e35a2ea3c274414bfcc2b12bfea043bd9ed0b77a58dd8e19459

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

class Ey::Core::Client
  class Real
    def destroy_user(params={})
      id  = params["id"]
      url = params.delete("url")

      request(
        :path   => "/users/#{id}",
        :url    => url,
        :method => :delete
      )
    end
  end

  class Mock
    def destroy_user(params={})
      url = params.delete("url")

      user_id = params["id"] || url && url.split('/').last

      self.data[:users][user_id]["deleted_at"] = Time.now

      response(
        :body   => nil,
        :status => 204,
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ey-core-3.6.6 lib/ey-core/requests/destroy_user.rb
ey-core-3.4.5 lib/ey-core/requests/destroy_user.rb
ey-core-3.6.5 lib/ey-core/requests/destroy_user.rb