Class: TochkaCyclopsApi::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/tochka_cyclops_api/response.rb

Overview

Class for processing the response received from the api bank

Class Method Summary collapse

Class Method Details

.create(request:, response:, method:) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/tochka_cyclops_api/response.rb', line 8

def self.create(request: ,response: ,method:)
  @request = request
  @method = method
  @body = JSON.parse(response.body)
  @response_schema = "TochkaCyclopsApi::Schemas::Responses::#{camel_case_method}".constantize
  @error_schema = 'TochkaCyclopsApi::Schemas::Responses::Error'.constantize

  call
end