Sha256: 49e1a122a7fef7a5e07802afd0b238181fe1fecce2437590eb59fda103dd1eff
Contents?: true
Size: 683 Bytes
Versions: 3
Compression:
Stored size: 683 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
3 entries across 3 versions & 1 rubygems