Sha256: 3fb743e286cdfd075573f884a81383e64063d08b8d818c1c09c5f6997df9af9f
Contents?: true
Size: 667 Bytes
Versions: 13
Compression:
Stored size: 667 Bytes
Contents
module ModernTimes module MarshalStrategy module JSON extend self def marshal_type :text end begin require 'json' def marshal(object) object.to_json end def unmarshal(msg) ::JSON::Parser.new(msg).parse end MarshalStrategy.register(:json => self) rescue LoadError => e def marshal(object) raise 'Error: JSON marshaling specified but json gem has not been installed' end def unmarshal(msg) raise 'Error: JSON marshaling specified but json gem has not been installed' end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems