Module: UVCService
- Includes:
- HttpRestClient, SpecPdfMapper, VinService
- Included in:
- BlackbookClient
- Defined in:
- lib/uvc_service.rb
Constant Summary collapse
- VEHICLE_BY_UVC_URL =
"#{BASE_URL}/UsedCarWS/UsedCarWS/UsedVehicle/UVC".freeze
- PDF_SPEC_BY_UVC_URL =
"#{BASE_URL}/UsedCarWS/UsedCarWS/PDFSpecs".freeze
Constants included from HttpRestClient
Constants included from VinService
VinService::VEHICLE_BY_VIN_URL
Instance Method Summary collapse
-
#pdf_data_by_vin(vin, query_params = {}) ⇒ Object
This method is used by web-system to generate vehicle spec pdfs for appraisers.
- #range_by_uvc(uvc_id, query_params = {}) ⇒ Object
- #spec_pdf_data(uvc, query_params = {}) ⇒ Object
Methods included from HttpRestClient
#headers, #make_request, #map_fields, #message_with_error, #process_response
Methods included from VinService
Methods included from RangeValuesMapper
Methods included from UvcMapper
Methods included from SpecPdfMapper
Instance Method Details
#pdf_data_by_vin(vin, query_params = {}) ⇒ Object
This method is used by web-system to generate vehicle spec pdfs for appraisers
32 33 34 35 36 |
# File 'lib/uvc_service.rb', line 32 def pdf_data_by_vin(vin, query_params = {}) response = uvc_by_vin(vin, query_params) return response unless response.last == 200 spec_pdf_data(response.first[:uvc], query_params) end |
#range_by_uvc(uvc_id, query_params = {}) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/uvc_service.rb', line 15 def range_by_uvc(uvc_id, query_params = {}) url = "#{VEHICLE_BY_UVC_URL}/#{uvc_id}" response = make_request(:get, url, query_params) return response unless response.last == 200 [RangeValuesMapper.map_fields(response.first), response.last] end |
#spec_pdf_data(uvc, query_params = {}) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/uvc_service.rb', line 23 def spec_pdf_data(uvc, query_params = {}) url = "#{PDF_SPEC_BY_UVC_URL}/#{uvc}" response = make_request(:get, url, query_params) return response unless response.last == 200 [SpecPdfMapper.map_fields(response.first), response.last] end |