Sha256: bc7dded0249ea6e1b01b5ed39599cd4b8852c0f8af48d9684575aeb0c1cc848b
Contents?: true
Size: 531 Bytes
Versions: 16
Compression:
Stored size: 531 Bytes
Contents
require 'delegate' require 'multi_xml' module Peddler # @api private class XMLParser < SimpleDelegator def next_token parse.fetch('NextToken', false) end def parse @result ||= find_result end def xml MultiXml.parse(body) end def valid? headers['Content-Length'].to_i == body.size if headers['Content-Length'] end private def find_result results = xml.values[0].find { |k, _| k.include?('Result') } results ? results.last : nil end end end
Version data entries
16 entries across 16 versions & 1 rubygems