Sha256: c9d661bfedfa5171cb75430a9b4bb05030411466ba7be02d2903828708277d9a

Contents?: true

Size: 313 Bytes

Versions: 8

Compression:

Stored size: 313 Bytes

Contents

module HorizonClient
  module Response

    class ResourceError < StandardError
    end

    class ParseXml < Faraday::Response::Middleware
      def parse(body)
        resource = Resource.new(body)

        raise ResourceError.new(resource.error) if resource.error

        resource
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
horizon_client-0.2.7 lib/horizon_client/response/parse_xml.rb
horizon_client-0.2.6 lib/horizon_client/response/parse_xml.rb
horizon_client-0.2.5 lib/horizon_client/response/parse_xml.rb
horizon_client-0.2.4 lib/horizon_client/response/parse_xml.rb
horizon_client-0.2.3 lib/horizon_client/response/parse_xml.rb
horizon_client-0.2.2 lib/horizon_client/response/parse_xml.rb
horizon_client-0.2.1 lib/horizon_client/response/parse_xml.rb
horizon_client-0.2.0 lib/horizon_client/response/parse_xml.rb