Class: Coronet::MessageFormat::YamlMessageFormat
- Defined in:
- lib/coronet/message_format/yaml_message_format.rb
Instance Method Summary collapse
-
#pack(hash) ⇒ Object
transform hash to yml string.
-
#unpack(yml_str) ⇒ Object
transform yml string to hash.
Methods inherited from Base
Instance Method Details
#pack(hash) ⇒ Object
transform hash to yml string
12 13 14 |
# File 'lib/coronet/message_format/yaml_message_format.rb', line 12 def pack(hash) yml_out = Psych.dump(hash) #.strip! end |
#unpack(yml_str) ⇒ Object
transform yml string to hash
6 7 8 9 |
# File 'lib/coronet/message_format/yaml_message_format.rb', line 6 def unpack(yml_str) Psych.load(yml_str) # YAML.load(yml_str) end |