Class: WeChat::Bot::HTTP::MimeType::XML

Inherits:
HTTP::MimeType::Adapter
  • Object
show all
Defined in:
lib/wechat/bot/http/adapter/xml.rb

Overview

XML 代码解析 提示:不可逆转

Instance Method Summary collapse

Instance Method Details

#decode(str) ⇒ Hash

转换 XML 代码为 Hash

Returns:

  • (Hash)


20
21
22
# File 'lib/wechat/bot/http/adapter/xml.rb', line 20

def decode(str)
  MultiXml.parse(str)
end

#encode(_) ⇒ Object

Encodes object to js



13
14
15
# File 'lib/wechat/bot/http/adapter/xml.rb', line 13

def encode(_)
  "" # NO NEED encode
end