示例#1
0
        public static Node /*!*/ ToYamlNode(RubyStruct /*!*/ self, [NotNull] RubyRepresenter /*!*/ rep)
        {
            var fieldNames = self.GetNames();

            var fields = new Dictionary <Node, Node>(fieldNames.Count);

            for (int i = 0; i < fieldNames.Count; i++)
            {
                fields[rep.Scalar(null, fieldNames[i], ScalarQuotingStyle.None)] = rep.RepresentItem(self.Values[i]);
            }

            var map = new Dictionary <object, object>();

            rep.AddYamlProperties(map, self, false);
            return(rep.Map(fields, rep.GetTagUri(self), map, FlowStyle.Block));
        }