Sha256: f3f2880b8bedb9fb65f7f5b4af3f47ee2ae2c43570c2e8d746e60149c19d1068
Contents?: true
Size: 661 Bytes
Versions: 11
Compression:
Stored size: 661 Bytes
Contents
require 'yaml' module ASIR class Coder # !SLIDE # YAML Coder # Use YAML for encode/decode. class Yaml < self def _encode obj case obj when Message, Result obj = obj.encode_more! end ::YAML::dump(obj) rescue ::Exception require 'pp' msg = "#{self}: failed to encode: #{$!.inspect}:\n #{PP.pp(obj, '')}" $stderr.puts msg raise Error, msg end def _decode obj case obj = ::YAML::load(obj) when Message, Result obj.decode_more! else obj end end end # class end # class end # module
Version data entries
11 entries across 11 versions & 1 rubygems