Sha256: 3b51b2fddc5f878b541cfda122d0a772e00618381734975797f04e8b8fc509ca

Contents?: true

Size: 388 Bytes

Versions: 2

Compression:

Stored size: 388 Bytes

Contents

require 'peddler/xml_parser'

module Peddler
  # @api private
  class XMLResponseParser < XMLParser
    def next_token
      parse.fetch('NextToken', false)
    end

    private

    def find_data
      results = xml.values.first.find { |k, _| k.include?('Result') } ||
                xml.values.first.find { |k, _| k == 'Message' }

      results ? results.last : nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peddler-1.1.0 lib/peddler/xml_response_parser.rb
peddler-1.0.2 lib/peddler/xml_response_parser.rb