Sha256: 9d30c0a443f5afb41f670064b966d8a09b857058ce885ad4018d3469b15478c9
Contents?: true
Size: 531 Bytes
Versions: 5
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, v| k.include?('Result') } results ? results.last : nil end end end
Version data entries
5 entries across 5 versions & 1 rubygems