ToNode() private method

private ToNode ( object obj ) : Node
obj object
return Node
示例#1
0
        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);
        }
示例#2
0
        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;
        }