Re: Simple Deserialization utility in Ruby.
Marvin Gülker <[email protected]>
| Newsgroups | gmane.comp.lang.ruby.general |
|---|---|
| Message-ID | <20181223124246.blqhzrv5bpbqbxs4@atlantis> |
Am 22. Dezember 2018 um 13:18 Uhr -0800 schrieb Vineel Yalamarthi: > Hi Guys > > I'm new to Ruby and wondering if there is a deserialization utility in > Ruby similar to Java's Google GSON library. There are a number of serialisers/deserialisers available actually: * Marshal, in core: https://ruby-doc.org/core-2.5.3/Marshal.html * YAML, in the stdlib: https://ruby-doc.org/stdlib-2.5.3/libdoc/yaml/rdoc/YAML.html * JSON, in the stdlib: https://ruby-doc.org/stdlib-2.5.3/libdoc/json/rdoc/JSON.html Marshal and YAML can directly (de)serialise Ruby objects, within certain restrictions. For instance, you cannot serialise File instances as they refer to an open file descriptor under the hood. Marvin -- Blog: https://mg.guelker.eu PGP/GPG ID: F1D8799FBCC8BC4F Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>