Sha256: c5e66959f1a80e473d6035b2e225a9c56f0285bb39c28e6ff550686f3b855b9b

Contents?: true

Size: 1.35 KB

Versions: 3

Compression:

Stored size: 1.35 KB

Contents

# frozen_string_literal: true

require_relative 'decode_xml/middleware'
require_relative 'decode_xml/version'

module Faraday
  # This will be your middleware main module, though the actual middleware implementation will go
  # into Faraday::DecodeXML::Middleware for the correct namespacing.
  module DecodeXML
    # Faraday allows you to register your middleware for easier configuration.
    # This step is totally optional, but it basically allows users to use a
    # custom symbol (in this case, `:decode_xml`), to use your middleware in their connections.
    # After calling this line, the following are both valid ways to set the middleware in a connection:
    # * conn.use Faraday::DecodeXML::Middleware
    # * conn.use :decode_xml
    # Without this line, only the former method is valid.
    Faraday::Response.register_middleware(xml: Faraday::DecodeXML::Middleware)

    # Alternatively, you can register your middleware under Faraday::Request or Faraday::Response.
    # This will allow to load your middleware using the `request` or `response` methods respectively.
    #
    # Load middleware with conn.request :decode_xml
    # Faraday::Request.register_middleware(decode_xml: Faraday::DecodeXML::Middleware)
    #
    # Load middleware with conn.response :decode_xml
    # Faraday::Response.register_middleware(decode_xml: Faraday::DecodeXML::Middleware)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
faraday-decode_xml-0.2.0 lib/faraday/decode_xml.rb
faraday-decode_xml-0.1.1 lib/faraday/decode_xml.rb
faraday-decode_xml-0.1.0 lib/faraday/decode_xml.rb