Sha256: f958f3c62a46f754bbe8a53a54303b0bb976d1fe2b29d516ce0ee8636fda3f87
Contents?: true
Size: 686 Bytes
Versions: 33
Compression:
Stored size: 686 Bytes
Contents
# frozen_string_literal: true module FriendlyShipping module Services class ShipEngine class ParseVoidResponse extend Dry::Monads::Result::Mixin def self.call(request:, response:) parsed_json = JSON.parse(response.body) approved, message = parsed_json["approved"], parsed_json["message"] if approved Success( ApiResult.new(message, original_request: request, original_response: response) ) else Failure( ApiFailure.new(message, original_request: request, original_response: response) ) end end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems