Module: HTTPX::Plugins::XML::Transcoder

Defined in:
lib/httpx/plugins/xml.rb,
sig/plugins/xml.rbs

Defined Under Namespace

Classes: Encoder

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.decode(response) ⇒ Object

Raises:



38
39
40
41
42
43
44
# File 'lib/httpx/plugins/xml.rb', line 38

def decode(response)
  content_type = response.content_type.mime_type

  raise HTTPX::Error, "invalid form mime type (#{content_type})" unless MIME_TYPES.match?(content_type)

  Nokogiri::XML.method(:parse)
end

.encode(xml) ⇒ Object



34
35
36
# File 'lib/httpx/plugins/xml.rb', line 34

def encode(xml)
  Encoder.new(xml)
end

Instance Method Details

#self?.decodeHTTPX::Transcoder::_Decoder

Parameters:

Returns:



8
# File 'sig/plugins/xml.rbs', line 8

def self?.decode: (HTTPX::Response response) -> HTTPX::Transcoder::_Decoder

#self?.encodeEncoder

Parameters:

  • xml (Nokogiri::XML::Node, String)

Returns:



7
# File 'sig/plugins/xml.rbs', line 7

def self?.encode: (Nokogiri::XML::Node | String xml) -> Encoder