module HTTPX::Transcoder::Xml

  1. lib/httpx/transcoder/xml.rb

Methods

Public Instance

  1. decode
  2. encode

Classes and Modules

  1. HTTPX::Transcoder::Xml::Encoder

Constants

MIME_TYPES = %r{\b(application|text)/(.+\+)?xml\b}.freeze  

Public Instance methods

decode(response)
[show source]
   # File lib/httpx/transcoder/xml.rb
39 def decode(response)
40   content_type = response.content_type.mime_type
41 
42   raise HTTPX::Error, "invalid form mime type (#{content_type})" unless MIME_TYPES.match?(content_type)
43 
44   Nokogiri::XML.method(:parse)
45 end
encode(xml)
[show source]
   # File lib/httpx/transcoder/xml.rb
32 def encode(xml)
33   Encoder.new(xml)
34 end