Sha256: b8058da57a86b276035a6773640bd5f07f95cd518133f6d9ccf21e402367dcd5

Contents?: true

Size: 432 Bytes

Versions: 4

Compression:

Stored size: 432 Bytes

Contents

# frozen_string_literal: true

require 'peddler/xml_parser'

module Peddler
  # @api private
  class XMLResponseParser < XMLParser
    MATCHER = /^Message$|Report|Result/
    private_constant :MATCHER

    def next_token
      parse.fetch('NextToken', false)
    end

    private

    def find_data
      payload = xml.values.first
      found = payload.find { |k, _| k.match(MATCHER) }

      found.last if found
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
peddler-1.6.7 lib/peddler/xml_response_parser.rb
peddler-1.6.6 lib/peddler/xml_response_parser.rb
peddler-1.6.5 lib/peddler/xml_response_parser.rb
peddler-1.6.4 lib/peddler/xml_response_parser.rb