Sha256: 3315d6f5ccde3fe174d7c4c07f7aa99673bb09111e8d7df8bd6429bd0af3388c

Contents?: true

Size: 448 Bytes

Versions: 1

Compression:

Stored size: 448 Bytes

Contents

module Faraday
  class Response::ParseXml < Response::Middleware
    begin
      require 'multi_xml'
    rescue LoadError, NameError => error
      self.load_error = error
    end

    def self.register_on_complete(env)
      env[:response].on_complete do |response|
        response[:body] = begin
          ::MultiXml.parse(response[:body])
        end
      end
    end

    def initialize(app)
      super
      @parser = nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
faraday_middleware-0.3.0 lib/faraday/parse_xml.rb