Class: App42::ImageProcessor::ImageProcessorResponseBuilder

Inherits:
App42ResponseBuilder show all
Defined in:
lib/imageProcessor/ImageProcessorResponseBuilder.rb

Overview

ImageProcessResponseBuilder class converts the JSON response retrieved from the server to the value object i.e Image

Instance Method Summary collapse

Methods inherited from App42ResponseBuilder

#buildObjectFromJSONTree, #getNames, #getServiceJSONObject, #getTotalRecords, #isResponseSuccess

Instance Method Details

#buildResponse(json) ⇒ Object

Converts the response in JSON format to the value object i.e Image

Parameters:

  • json
    • response in JSON format

Returns:

  • Image object filled with json data



29
30
31
32
33
34
35
36
# File 'lib/imageProcessor/ImageProcessorResponseBuilder.rb', line 29

def buildResponse(json)
  imageJSONObj = getServiceJSONObject("image", json)
  imageObj = Image.new
  imageObj.strResponse=json
  imageObj.isResponseSuccess= isResponseSuccess(json)
  buildObjectFromJSONTree(imageObj, imageJSONObj);
  return imageObj
end