Method: OneAndOne::User#ips

Defined in:
lib/1and1/user.rb

#ips(user_id: @id) ⇒ Object



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/1and1/user.rb', line 277

def ips(user_id: @id)

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

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

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

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

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

end