Method: OneAndOne::User#delete

Defined in:
lib/1and1/user.rb

#delete(user_id: @id) ⇒ Object



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/1and1/user.rb', line 158

def delete(user_id: @id)

  # If user passed in user ID, reassign
  @id = user_id

  # Build URL
  path = OneAndOne.build_url("/users/#{@id}")

  # Perform request
  response = @connection.request(:method => :delete,
    :path => path,
    :headers => $header)

  # Check response status
  OneAndOne.check_response(response.body, response.status)

  #JSON-ify the response string
  JSON.parse(response.body)

end