Sha256: f3632c867cfcfde686436456a7b6e5ba9a3cec71890dfae061160fde0bdc2fcd

Contents?: true

Size: 671 Bytes

Versions: 7

Compression:

Stored size: 671 Bytes

Contents

# frozen_string_literal: true

require 'dry/monads/result'

module FriendlyShipping
  module Services
    class Ups
      class ParseVoidShipmentResponse
        def self.call(request:, response:)
          parsing_result = ParseXMLResponse.call(
            request: request,
            response: response,
            expected_root_tag: 'VoidShipmentResponse'
          )
          parsing_result.fmap do |xml|
            FriendlyShipping::ApiResult.new(
              xml.root.at('ResponseStatusDescription').text,
              original_request: request,
              original_response: response
            )
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
friendly_shipping-0.6.5 lib/friendly_shipping/services/ups/parse_void_shipment_response.rb
friendly_shipping-0.6.4 lib/friendly_shipping/services/ups/parse_void_shipment_response.rb
friendly_shipping-0.6.3 lib/friendly_shipping/services/ups/parse_void_shipment_response.rb
friendly_shipping-0.6.2 lib/friendly_shipping/services/ups/parse_void_shipment_response.rb
friendly_shipping-0.6.1 lib/friendly_shipping/services/ups/parse_void_shipment_response.rb
friendly_shipping-0.6.0 lib/friendly_shipping/services/ups/parse_void_shipment_response.rb
friendly_shipping-0.5.3 lib/friendly_shipping/services/ups/parse_void_shipment_response.rb