Sha256: e2dc00c6dac365ffda4746b439531d2f10cddcd6cb3b4e3e91ee5ada3cde030f

Contents?: true

Size: 405 Bytes

Versions: 3

Compression:

Stored size: 405 Bytes

Contents

# frozen_string_literal: true

module MWS
  module Orders
    class Document
      attr_reader :node

      def initialize(node)
        @node = node
      end

      def xpath(path)
        node.xpath(add_namespace(path))
      end

      private

      def add_namespace(path)
        path
          .split('/')
          .map { |attr| "xmlns:#{attr}" }
          .join('/')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mws-orders-0.4.0 lib/mws/orders/document.rb
mws-orders-0.3.1 lib/mws/orders/document.rb
mws-orders-0.3.0 lib/mws/orders/document.rb