class Fog::XML::Response

Public Class Methods

new(parser) click to toggle source
# File lib/fog/xml/response.rb, line 4
def initialize(parser)
  @parser = parser
  @data_stream = Nokogiri::XML::SAX::PushParser.new(parser)
  @response_string = ""
end

Public Instance Methods

call(chunk, _remaining, _total) click to toggle source
# File lib/fog/xml/response.rb, line 10
def call(chunk, _remaining, _total)
  @response_string << chunk if ENV["DEBUG_RESPONSE"]
  @data_stream << chunk
end
finish() click to toggle source
# File lib/fog/xml/response.rb, line 20
def finish
  Fog::Logger.debug "\n#{@response_string}" if ENV["DEBUG_RESPONSE"]
  @data_stream.finish
end
rewind() click to toggle source
# File lib/fog/xml/response.rb, line 15
def rewind
  @parser.reset
  @response_string = ""
end