Module: Isaca::Request::GetUserByID

Defined in:
lib/isaca/requests/get_user_by_id.rb

Overview

Class used to fetch an ISACA user by their IMIS ID.

Class Method Summary collapse

Class Method Details

.get(id) ⇒ Isaca::Model::GetUserByID

Method fetches ISACA user by IMIS ID.



10
11
12
13
# File 'lib/isaca/requests/get_user_by_id.rb', line 10

def self.get(id)
  response = self.send_request(id)
  Isaca::Model::GetUserByID.new(JSON.parse(response.body, symbolize_names: true))
end

.send_request(id) ⇒ Faraday::Response

Method used to send the request – exists to ease testing.



22
23
24
25
26
27
# File 'lib/isaca/requests/get_user_by_id.rb', line 22

def self.send_request(id)
  Isaca::Request.get do |request|
    request.path = request.path + '/GetUserByID'
    request.params['ID'] = id
  end
end