Sha256: 746b09147c83ecd7f9f7dd9767a2084b3e1f84eff78b36a4e2adf1f5efdc6abd

Contents?: true

Size: 312 Bytes

Versions: 8

Compression:

Stored size: 312 Bytes

Contents

module HorizonClient
  module Request
    class EncodeXml < Faraday::Middleware
      def call(env)
        env[:body] = encode env[:body]
        @app.call env
      end

      def encode(payload)
        payload.is_a?(Resource) ? Ox.dump(payload.document, with_xml: true) : payload
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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