Class: ICIMS::GetRequest

Inherits:
Object
  • Object
show all
Includes:
Requestable
Defined in:
lib/icims/get_request.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ GetRequest

Returns a new instance of GetRequest.



6
7
8
# File 'lib/icims/get_request.rb', line 6

def initialize url
  @url = url
end

Class Method Details

.perform(url) ⇒ Object



21
22
23
# File 'lib/icims/get_request.rb', line 21

def perform(url)
  new(url).call
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
# File 'lib/icims/get_request.rb', line 10

def call
  request = get_request_object
  ICIMS.logger.info "#{request.method} #{uri.to_s}"
  response = ssl_connection.request(request)
  parsed_response = JSON.parse(response.body)
  ICIMS.logger.info parsed_response
  parsed_response
end