class FioAPI::ImportResponseDeserializer
ImportResponseDeserializer
¶ ↑
Deserializer responsible for response json deserializing. Should construct object with status attributes.
Attributes
status[RW]
Public Instance Methods
deserialize(json)
click to toggle source
Private Instance Methods
deserialize_import(response_json)
click to toggle source
Deserialize import of payments
Parameters:¶ ↑
- response_json
-
Hash
with informations about payments
Returns:¶ ↑
Status
# File lib/base/deserializers/import_response_deserializer.rb, line 41 def deserialize_import(response_json) return FioAPI::Payments::Status.new(error_code: 500) unless response_json FioAPI::Payments::Status.new( error_code: response_json.try_path('errorCode').to_i, error_message: response_json.try_path('message').to_s, id_instruction: response_json.try_path('idInstruction').to_i, sum_credit: response_json.try_path('sums', 'sum', 'sumCredit').to_f, sum_debet: response_json.try_path('sums', 'sum', 'sumDebet').to_f ) end