Class: Coronet::MessageFormat::YamlMessageFormat

Inherits:
Base
  • Object
show all
Defined in:
lib/coronet/message_format/yaml_message_format.rb

Instance Method Summary collapse

Methods inherited from Base

#transform

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