Class: Coronet::MessageFormat::XmlMessageFormat
- Defined in:
- lib/coronet/message_format/xml_message_format.rb
Instance Method Summary collapse
-
#pack(hash) ⇒ Object
transform hash to xml string.
-
#unpack(xml_str) ⇒ Object
transform xml string to hash.
Methods inherited from Base
Instance Method Details
#pack(hash) ⇒ Object
transform hash to xml string
10 11 12 |
# File 'lib/coronet/message_format/xml_message_format.rb', line 10 def pack(hash) XmlSimple.xml_out(hash, noattr: true, rootname: nil).strip! end |
#unpack(xml_str) ⇒ Object
transform xml string to hash
5 6 7 |
# File 'lib/coronet/message_format/xml_message_format.rb', line 5 def unpack(xml_str) XmlSimple.xml_in(xml_str, forcearray: false, keeproot: true) end |