Sha256: ab428d4d4e7df9f9af90e1413354176c2bfe448514c5fb5557b5124f46e485af

Contents?: true

Size: 401 Bytes

Versions: 4

Compression:

Stored size: 401 Bytes

Contents

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.3 lib/peddler/xml_response_parser.rb
peddler-1.6.2 lib/peddler/xml_response_parser.rb
peddler-1.6.1 lib/peddler/xml_response_parser.rb
peddler-1.6.0 lib/peddler/xml_response_parser.rb