public static object QuickEmit(YamlCallSiteStorage /*!*/ siteStorage, [NotNull] BlockParam /*!*/ block, RubyModule /*!*/ self, object objectId, [NotNull] Hash /*!*/ opts) { // TODO: load from opts YamlOptions cfg = YamlOptions.DefaultOptions; MutableStringWriter writer = new MutableStringWriter(MutableString.CreateMutable(RubyEncoding.Binary)); Serializer s = new Serializer(writer, cfg); RubyRepresenter rep = new RubyRepresenter(siteStorage); object result; if (block.Yield(new Syck.Out(rep), out result)) { return(result); } s.Serialize(rep.ToNode(result)); s.Close(); return(writer.String); }
public static object QuickEmit(YamlCallSiteStorage/*!*/ siteStorage, [NotNull]BlockParam/*!*/ block, RubyModule/*!*/ self, object objectId, [NotNull]Hash/*!*/ opts) { // TODO: load from opts YamlOptions cfg = YamlOptions.DefaultOptions; MutableStringWriter writer = new MutableStringWriter(MutableString.CreateMutable(RubyEncoding.Binary)); Serializer s = new Serializer(writer, cfg); RubyRepresenter rep = new RubyRepresenter(siteStorage); object result; if (block.Yield(new Syck.Out(rep), out result)) { return result; } s.Serialize(rep.ToNode(result)); s.Close(); return writer.String; }