Sha256: b6c2ef28717d175a346bd27b39ecc908c2650157ab76c40e11a78be4c0c64a08
Contents?: true
Size: 684 Bytes
Versions: 7
Compression:
Stored size: 684 Bytes
Contents
module Fog class Connection def initialize(url, persistent=false, params={}) @excon = Excon.new(url, params) @persistent = persistent end def request(params, &block) unless @persistent reset end unless block_given? if (parser = params.delete(:parser)) body = Nokogiri::XML::SAX::PushParser.new(parser) block = lambda { |chunk, remaining, total| body << chunk } end end response = @excon.request(params, &block) if parser body.finish response.body = parser.response end response end def reset @excon.reset end end end
Version data entries
7 entries across 7 versions & 3 rubygems