Sha256: 027da491d0a61cfee86b14d57fafe633e71f51e685c3a1097c9358ebec49d722
Contents?: true
Size: 660 Bytes
Versions: 15
Compression:
Stored size: 660 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| 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
15 entries across 15 versions & 3 rubygems